Serve Only The Files You Need With Webpack - Webpack Setup

Опубликовано: 12 Октябрь 2024
на канале: Class Outside
89
2

Delivering files and modules to browsers can be slow, and exposing node_modules with server software like Express.js may cause security risks. Together we can walk through combining our files, and only serve what is necessary to the browser, by using the bundling software Webpack! This may also simplify importing libraries in a Node.js and Express.js setup.

Downloads:
Starter Project, No Webpack: https://github.com/ClassOutside/Webpa...
Complete Project, Webpack setup: https://github.com/ClassOutside/Webpa...

Tutorials:
Setup a Local Server With Node.js and Express.js:    • Set Up a Local Server and Connect Fro...  

Commands:
npm install --save-dev webpack webpack-cli babel-loader @babel/core
npx webpack --config .\webpack.configure.js

Further Information:
Tree Shaking in Webpack: https://blog.logrocket.com/tree-shaki...
Webpack performance optimization: https://blog.logrocket.com/guide-perf...
Babel-loader: https://webpack.js.org/loaders/babel-...
Babel/preset-env: https://babeljs.io/docs/babel-preset-env
Babel/preset-env browser defaults: https://github.com/browserslist/brows...

Music: "Relaxed Vlog" by Ashot-Danielyan-Composer from Pixabay