Webpack Flashcards
[webpack] config.module.rules.push() - wat doet dit?
This adds a new rule to the webpack module rules array
[webpack] test: /.svg$/
This rule applies to files with the .svg extension
[webpack] include: /node_modules\/assets/
include: /node_modules\/assets/ - This restricts the rule to only apply to the rule files within the node_modules/assets directory
[webpack] use: { loader: ‘url-loader’ }
use: { loader: ‘url-loader’ } - It specifies that these SVG files should be processed using the ‘url-loader’
[webpack] options: { name: ‘[name].[hash].[ext]’ }
Keep the original filename ([name])
Add a content hash for cache busting ([hash])
Keep the original extension ([ext])
[webpack] wat doet ‘bundling’?
Bundling: It takes various JavaScript files (and their dependencies) and combines them into one or more optimized bundles for the browser.
[webpack] wat doet Module resolution?
Module resolution: Webpack understands different module systems (CommonJS, ES modules) and resolves dependencies between them.
[webpack] wat doet Loaders?
Loaders: It transforms non-JavaScript files (like CSS, images, SVG, TypeScript, etc.) into modules that can be included in your JavaScript bundle through specialized loaders (like the url-loader in your example).
[webpack] wat doet Code splitting?
Code splitting: It can split your code into chunks that load on demand, improving initial load performance.
[webpack] wat doet Asset optimization?
Asset optimization: It can minify, compress, and optimize your code and assets for production.
[webpack] wat doet Development Tools?
Development tools: It provides features like hot module replacement for faster development.