[Vuejs]-Webpack not creating bundle.js or error messages

0👍

Your dev script only runs the Webpack dev server, so nothing would be written into dist. Also, bundling only occurs (and the dist folder created and filled) when you run the build script (npm run build).

But your project appears to be a Vue CLI scaffolded project (based on the @vue/cli-service dependencies), which transitively depends on Webpack, so you don’t need to add a dependency on webpack or webpack-cli.

Your Webpack config doesn’t seem to do anything that isn’t already done by default in Vue CLI scaffolded projects. I recommend just sticking with the serve and build scripts. If you need to change the Webpack config, use vue.config.js‘s configureWebpack or chainWebpack. See Working with Webpack for reference.

Leave a comment