Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2universalStack: javascript
webpackbuilddependenciesbundling
Don't compile third-party libraries through your own bundler config
Prefer including a prebuilt/minified vendor bundle over running an external library through your webpack rules, which may differ from what the library expects.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejavascript
| 1 | // webpack: include and transpile the raw ad-loader source through our own loaders |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | // reference the library's prebuilt minified bundle directly |
| 2 | externals: { adLoader: 'AdLoader' } |
Explanation (EN)
Objašnjenje (HR)