Webpack is a tool to package css, js and other web formats.
Getting Started guide here
Initialize npm in the giotto/statics/configs
folder:
> cd giotto/statics/configs
> npm init -y
> install webpack webpack-cli html-webpack-plugin mini-css-extract-plugin babel-loader @babel/core --save-dev
You should now have the below structure in statics
statics
├── /configs
├── node_modules
├── src
├── index.html
├── package.json
The npm packages are tracked inside statics/configs/package.json
. In order to make sure you have all the npm packages installed, do the following:
> cd giotto/statics/configs
> npm install
This will save all the required npm packages inside the local folder node_modules
inside statics
.
You can do:
> npm run start
In order to run 1 compile.
You can do:
> npx webpack --watch
To watch with webpack.