S
S
Swartex2019-03-04 23:05:10
webpack
Swartex, 2019-03-04 23:05:10

How to compile a vuejs project into one file?

I am writing my small VueJS project using vue-cli-3. And I can’t figure out how to set up the build configuration so that the build goes to one file (for example, app.js).
This problem is solved by the template for webpack`a (wepback-simple), but I want to understand how to manually configure the collector. And don't pull the left template.
Now when I execute the command vue-cli-service buildI get a dist folder with subdirectories inside (js/css/img)
For vue-cli-3 there is another configuration file vue.config.js. Can you tell me how to set up such a build?
If there is no other way how to use wepback-simple template then so be it :(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Robur, 2019-03-04
@Robur

If you want exactly the same as in the webpack-simple template, then look there: https://github.com/vuejs-templates/webpack-simple/... By default, webpack collects js into one file. vue-cli should also build all
js into one file by default, with some exceptions described here: https://cli.vuejs.org/guide/build-targets.html#app
push one file, along with pictures and styles, then the question arises why? it's not the best idea. If only js and they are not already in the same file - you need to look at why, since there should be a standard output bundle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question