Secret Tips to Improve Your Webpack Configuration
summary
Webpack runs with no config by default, supports running the config as TypeScript via ts-node, and accepts functions or async functions that receive env flags so builds change per flag. Multi-compiler mode builds multiple configs concurrently in one process (not parallel); parallel-webpack spawns real parallel workers. Nodemon restarts on config changes. Use require.resolve to validate paths, use .oneOf to stop multiple loader matches, prefer include over exclude, and use issuer or resourceQuery to apply different loaders. Webpack 5 adds an asset module type.
AI-written summary · about
chapters (13)
- 0:00Intro
- 1:16ReactiveConf 2019 Secret Tips to Improve Your Webpack Config.
- 1:44You don't need a webpack config.
- 3:17TypeScript support.
- 5:36Function as config.
- 7:25Multi- compiler mode.
- 9:51#5 Async webpack configs.
- 14:30Use .filter (Boolean)
- 15:46Avoid config logic.
- 17:02Use module.rules [].oneOf.
- 19:24test for file extensions, include for absolute paths.
- 20:55"How to apply different loaders on the same module" Pt 1.
- 23:15#12 "How to apply different loaders on the same module" Pt 2.








