-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you forgot to remove this log 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops!
template/package.json
Outdated
@@ -70,6 +67,7 @@ | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should move this line outside of unit
so it always gets installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right. thanks!
This file is not transpiled, so we should stick to ES5
template/package.json
Outdated
@@ -5,7 +5,7 @@ | |||
"author": "{{ author }}", | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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}`], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/You/Your/
…e webpack config. Reasoning: thosen file imports are not configuration, so they don't belong inside of config/index.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
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.js
and/config/dev-client.js
are gonewebpack.dev.conf.js
now returns a promise. This was necessary to keep the recently added portfinder feature working without writing a newdev-server.js
file that wrapswebpack-dev-server
webpack-dev-server
configuration, but most of the usually used options can be configured from/config/index.js
/test/e2e/runner.js
was 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.js
npm run build
).notifyOnErrors
option:/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 . nameForTestDirectory
to test itAnd report any and all problems in this PR thread. Thanks!