Intro
Video: https://www.youtube.com/watch?v=GU-2T7k9NfI
npm install webpack --save-dev
Webpack helps compose the frontend files and dependency imports.
package.json
1 | "scripts":{ |
Webpack dev server
npm install --save-dev webpack-dev-server
package.json
1 | "scripts":{ |
npm run build
will serve the files from local server.
Webpack core concepts
entry => module loaders => plugins => output
webpack.config.js
1 | const path = require('path'); |
package.json
1 | "scripts":{ |
Loader & Modules
Modules and loaders allow us to transform the files.
npm install css-loader style-loader --save-dev
- Loaders are applied on a file base
- Plugins are applied to the whole bundle
Babel + SCSS example: https://www.youtube.com/watch?v=8vnkM8JgjpU&list=PL55RiY5tL51rcCnrOrZixuOsZhAHHy6os&index=4