-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Add a watch mode #1317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sure, we can take a PR for |
This new featured have a side effect: since the hash on filename changes every time, the dist folder starting to have all old versions from the same file Besides that, is there a way to allow other flag or something to avoid |
Yeah, this makes sense. I'm always using Edit: Changes are now in see #1430. |
Is there any possibility to activate HMR mode with this command: Like: I would like to say that it's primary on not SPA environments. |
If you are using |
Yes, indeed, before I was using the webpack-hot-middleware with my existing server. But with the CLI I don't have this choice anymore. I'll try to find an alternative solution or to make webpack-hot-middleware work with the CLI. |
I met two problems with
Here's my module.exports = {
outputDir: 'public',
pages: {
dashboard: {
entry: 'client/src/dashboard/app.js',
template: 'client/public/index.html',
filename: '../resources/views/dashboard.blade.php',
chunks: ['chunk-vendors', 'chunk-common', 'dashboard']
}
},
chainWebpack (config) {
config.resolve
.alias
.set('@', path.resolve(__dirname, 'client/src'))
.end()
},
} With version 3.0.3 |
I can confirm what @meteorlxy experienced:
|
@meteorlxy I found a workaround, but I'm not 100% sure what the issue is or why it works. Today is my first day using vue-cli or webpack for that matter! This issue tipped me off: #1617 Setting the
If anyone would explain what's actually going on, that would be awesome :D |
1.) running |
Yeah, thanks.
I notice that the vue-cli/packages/@vue/cli-service/lib/config/prod.js Lines 6 to 9 in ce335da
Maybe it's not good to discuss here, I'll try to open another issue for that. 😄 |
LOL that's really an insteresting workaround 😄 I'll try it out. Thank you! |
I have the same problem, integrating a vuejs app into an existing website. For that I actually am not using the dev server but the existing website local server to render the page. But with the current cli setup I think it is a bit complicated to do so: So I have to either change the vuejs JS inlucde folder everytime I want to deploy the app (from root to /js), or develop in production mode. Wouldn´t it make more sense to put the js files into the same folder regardless if we are using production or development mode? |
I also support using JS (and optionally CSS) subdirectories both in development and production mode. I am currently working on a project that uses Vue with CMS. The CMS requires including assets using its own including methods, hence it'd be convenient to fetch the assets from their dedicated directories as opposed to build separate configs for development and production modes. EDIT: I was able to compile JS files into a JS directory even in development mode when I explicitly set the webpack output filename in vue.config.js. Here's the change: chainWebpack: (config) => {
config
.output
.filename('js/[name].js');
}, |
To create different output directories for prod vs development you can do something like this in your vue.config.js:
|
same problem like @gtso86 |
I also ran into this problem in a situation where I am integrating vue into an existing project and can not use the dev server, but I still want to rebuild the package automatically whenever something changes. After much searching, the best workaround I found was to limit and restrict these files to a dir that is in
I would prefer a solution that cleans them up automatically whenever they are generated, if anyone knows of one. |
I have the same problem. This is my
|
Guys for my cloud based environment I really need css files created, I do not need hot module replacement since I can see visual change only after files are uploaded to server(there is no option for localhost development) So files are compiled and instantly uploaded to server, currently to make it work I have to use vue-cli-service build --watch --mode production This way I get the correct code with css files created, but I would like to also have possibility to do I think it can speed up the build a bit. I am using vue.config.js for my configuration Can you please help? |
I agree. When running without the built-in serve, it should be possible to have a watch in dev mode that creates the same directory structure, else Vue CLI is too opinionated and means dispensing with the CLI altogether and creating a regular Webpack config. |
Can you confirm that the |
It is using the config file. The only thing that ...which only sets weback's It doesn'T skip or change anything else. |
This is my
When I build with |
vue.config.js is being used. This is mine:
And in both --watch and non --watch modes the files are written to ./public (the default is ./dist) My package.json script commands are:
The problem is that in --watch mode OR in --mode development, a different directory structure is created, as already noted. --watch with --mode production creates the full directory structure, as desired, but production mode is not wanted during development. |
I am doing this
it only creates
why not any CSS files? |
What problem does this feature solve?
Sometimes you don't want to serve html and other build files with integrated
serve
command.Requirements
watch
command option needs to take into accountvue.config.js
'soutputDir
or--dest
. (I'm guessing this would work out of the box even). I think it's actually same as runningwebpack-cli
withwebpack --watch
.Would you be willing to merge a PR that adds this command / command option?
What does the proposed API look like?
or (preferably)
The text was updated successfully, but these errors were encountered: