question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a build --watch flag that writes to the disk in development

See original GitHub issue

What 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:closed
  • Created 5 years ago
  • Reactions:23
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

29reactions
dhenschecommented, Apr 12, 2018

A quick workaround, until this feature is possibly added could be to add the following entry to the scripts section of your package.json "watch": "webpack --config ./node_modules/@vue/cli-service/webpack.config.js --watch". Then you can just run yarn watch or npm run watch

18reactions
WisdomSkycommented, Oct 22, 2018

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:

module.exports = {
    chainWebpack(config) {
            config.output.filename("js/[name].js");
    }
}

And you don’t need to install additional plug-ins,

you can just run:

npx vue-cli-service build --watch

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” },

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found