Switch to webpack-dev-server (close #964)#975
Conversation
|
Looks good to me on first glance - good to merge with one additional person testing it locally to make sure it works as intended. |
|
Package "node-notifier" is missing in the list of dependencies in generated packages.json and it is now used in utils.js |
|
Thanks. Weird, no idea how that got lost but it's easy to fix :) |
|
@grakic I just checked, it's not missing? But anyway, I realized that I fixed a specific version which is not necessary, so I will push a small fix. |
template/build/utils.js
Outdated
| if (severity !== 'error') { | ||
| return | ||
| } | ||
| console.log('it should notify!!') |
There was a problem hiding this comment.
I think you forgot to remove this log 🙂
template/package.json
Outdated
| "karma-spec-reporter": "0.0.31", | ||
| "karma-webpack": "^2.0.2", | ||
| "mocha": "^3.2.0", | ||
| "node-notifier": "^5.1.2", |
There was a problem hiding this comment.
You should move this line outside of unit so it always gets installed
There was a problem hiding this comment.
Oh, right. thanks!
This file is not transpiled, so we should stick to ES5
template/package.json
Outdated
| "private": true, | ||
| "scripts": { | ||
| "dev": "node build/dev-server.js", | ||
| "dev": "webpack-dev-server --inline --hot --progress --config build/webpack.dev.conf.js", |
There was a problem hiding this comment.
We need to remove line 38 and 39 from build/webpack.dev.conf.js
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.HotModuleReplacementPlugin(),The --hot is the only one needed
template/build/webpack.dev.conf.js
Outdated
| // Add FriendlyErrorsPlugin | ||
| devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ | ||
| compilationSuccessInfo: { | ||
| messages: [`You application is running here http://${config.dev.host}:${port}`], |
…e webpack config. Reasoning: thosen file imports are not configuration, so they don't belong inside of config/index.js
|
I don't know what is going on, but I wanted to try the dev branch with the switch to I added postcss-loader because it's not in After that the dev server is up and running but with annoying warnings : Maybe I wasn't suppose to add |
|
Hey, thanks for reporting. That may very well. Be the case, it's the dev branch. Some PRe that I merged probably need some refinement, I plan to look into this at the weekend |
|
To be honest, this is quite annoying: It messes up my own debugging workflow with logs. Is there any way to disable those messages? @LinusBorg |
|
I think clientLogLevel should be the setting you are looking for. I probably should set this to something more reasonable, thanks for the pointer. |
|
Switched it to "error" and worked just fine! |
…ates#975) * Finished testable version. * close vuejs-templates#960 * fix node-notifier version * remove console.log * moved general dependency out of unit test-only dependency block. * fix typo * ignore /test folder * make HMR work correctly. * improve console messages for HMR - now show filenames of replaced modules. * fix typo in eslint-loader config * move imports for the env files from /config/index.js directly into the webpack config. Reasoning: thosen file imports are not configuration, so they don't belong inside of config/index.js * fix wrong overlay config
…ates#975) * Finished testable version. * close vuejs-templates#960 * fix node-notifier version * remove console.log * moved general dependency out of unit test-only dependency block. * fix typo * ignore /test folder * make HMR work correctly. * improve console messages for HMR - now show filenames of replaced modules. * fix typo in eslint-loader config * move imports for the env files from /config/index.js directly into the webpack config. Reasoning: thosen file imports are not configuration, so they don't belong inside of config/index.js * fix wrong overlay config


Why?
The reasons for this change are laid out in #964
What changed?
/config/dev-server.jsand/config/dev-client.jsare gonewebpack.dev.conf.jsnow returns a promise. This was necessary to keep the recently added portfinder feature working without writing a newdev-server.jsfile that wrapswebpack-dev-serverwebpack-dev-serverconfiguration, but most of the usually used options can be configured from/config/index.js/test/e2e/runner.jswas changed quite a bit to make it work withwebpack-dev-server, but it works just fine.What was added?
This PR also has a few goodies, all otpional changes are reachable through
/config/index.jsnpm run build).notifyOnErrorsoption:/config/index.js:Testing this PR
@vuejs-templates/collaborators and anyone interested: Please take this for a test-ride with:
Edit: Appearantly the branch name breaks vue-cli, so you will have to check out the branch locally and then run
vue init . nameForTestDirectoryto test itAnd report any and all problems in this PR thread. Thanks!