Introduction
By default, Vue CLI build target is App
which means your static will auto inject to a static index.html
file. If you want to manual inject static to an existing app like Django, Laravel, etc then you may want to remove webpack html plugin.
Before going further, you can check your Vue CLI version by this command:
vue --version
Modify Vue CLI config file
Navigate to your Vue CLI project root directory and looking for vue.config.js
file or create one if it does not exist, modify it and it will look like this:
|
|
Next, update your package.json
file, change serve
command to vue-cli-service build --watch --mode development
and run npm run serve
to see the result:
File Size Gzipped
dist/js/index.js 1029.51 KiB 216.73 KiB
dist/css/index.css 236.82 KiB 28.87 KiB
That’s it, you’re ready to create an incoming awesome app :)
In the next article, I will try to modify Vue CLI to auto inject CSS files without doing it manually, maybe combine without hot reload too.
[Updated] Here is the part 2 with simple configuration and hot reload.