Location of webpack config file in vue-cli webpack project?

Ragas picture Ragas · Nov 30, 2017 · Viewed 10.7k times · Source

I used cli to create a vue.js project. I used the webpack template for it. I have been working on it for a few days and it working smoothly.

Now I need to add a npm package to the project. This package recommends I make some changes to webpack config. But there is not webpack.config.js file at the root of my project. Where is the webpack config file. Do i need to run a command to publish it like in some frameworks.

Answer

Vamsi Krishna picture Vamsi Krishna · Nov 30, 2017

The webpack-simple template has the webpack-config.js file directly in root of your project folder.

Looks like you are using webpack template. To make changes to the webpack config goto the build folder.

There you will find 3 files related to the webpack config;

  1. webpack.base.conf.js
  2. webpack.dev.conf.js
  3. webpack.prod.conf.js

You can make the change your package requires in the webpack.base.conf.js file or in webpack.dev.conf.js if the change is for development time config or in webpack.prod.conf.js if its for production build config