Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate vue-cli with existing unrelated webpack setup in the same project?

I have a project with an existing webpack setup and it's unrelated to Vue.

Until now I have multiple entry points setups and some of these entry points are opening some iframes popups, and the plan is to build these iframes with VUE.

This means that I will also have multiple VUE entry points, this shouldn't be a problem but what I can't figure out is:

  • what is the best way to add VUE-cli into this already existing setup and use the same node_modules folder

  • Also to be able to add the vue-cli build commands to be run/triggered after my existing webpack build commands.

Let me know if more details are needed?

like image 908
infloent Avatar asked Jan 20 '26 09:01

infloent


1 Answers

I've figure it out and it turn out that you can have both in the same project.

I've used vue create on my existing project folder and there is a prompt with a merge options.

Unfortunately it deleted my dependencies but was not such a big deal. Just had to reinstall them.

Now my project's webpack configuration remained completely separate form vue-cli which is handled by the vue.config.js and this is exactly what I wanted.

I am using something like this to build everything at once:

"build": "webpack --config webpack.prod.js && vue-cli-service build"
like image 150
infloent Avatar answered Jan 23 '26 07:01

infloent



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!