This quick start sample project is prepared by following this tutorial : https://www.valentinog.com/blog/webpack-tutorial/
Move into directory and run :
$ npm i && npm run start
To change output file; use output flag in package.json
under scripts :
"scripts": {
"dev": "webpack --mode development ./foo/src/js/index.js --output ./foo/main.js",
"build": "webpack --mode production ./foo/src/js/index.js --output ./foo/main.js"
}
To change entry point;
- add ;
entry: './foo/index.js',
in module export section ofwebpack.config.js
. - change ;
"./foo/index.html",
in plugins section ofwebpack.config.js
.