Add a build --watch flag that writes to the disk in development
See original GitHub issueWhat problem does this feature solve?
I would like to serve the Vue as a SPA app inside of the ASP.NET application. With the existing serve
command, I do not have access to the files on the disk, so I cannot accomplish that. With a build --watch flag, it would run the webpack build, watch for file changes, and run the build on file changes.
Ionic supports this (ionic-app-scripts watch), Angular CLI supports this (ng build --watch), and these allow me to write Angular/Ionic apps and use them as part as my web application.
What does the proposed API look like?
vue-cli-service build --watch
or vue-cli-service watch
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:23
- Comments:19 (5 by maintainers)
Top Results From Across the Web
Webpack: How to compile, write on disk and serve static ...
To address that chore, include the watch flag. From the Terminal, you could execute the command: $ webpack --watch.
Read more >Watch and WatchOptions | webpack
Verify that webpack is not being notified of changes by running webpack with the --progress flag. If progress shows on save but no...
Read more >Creating and managing build triggers - Google Cloud
A Cloud Build trigger automatically starts a build whenever you make any changes to your source code. You can configure the trigger to...
Read more >Development - Parcel
Parcel includes a development server out of the box supporting hot reloading, HTTPS, an API proxy, and more. ... Parcel caches everything it...
Read more >Ahead-of-time (AOT) compilation - Angular
The AOT compiler detects and reports template binding errors during the build step before users can see them. Better security, AOT compiles HTML...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A quick workaround, until this feature is possibly added could be to add the following entry to the
scripts
section of yourpackage.json
"watch": "webpack --config ./node_modules/@vue/cli-service/webpack.config.js --watch"
. Then you can just runyarn watch
ornpm run watch
Okay. So after a little bit of fiddling, you can prevent the flattening of the js directory by specifying the output file name in the
vue.config.js
:And you don’t need to install additional plug-ins,
you can just run:
or add it into your
package.json
:“scripts”: { “serve”: “vue-cli-service serve”, “build”: “vue-cli-service build”, “watch”: “vue-cli-service build --watch”, “dev”: “vue-cli-service build --mode development” },