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
Gulp update #1696
Gulp update #1696
Conversation
…date Conflicts: gulp/development.js package.json packages/custom/meanStarter/public/index.js webpack.config.js
Nice! On Oct 28, 2016 18:45, "pashist" notifications@github.com wrote:
|
This is awesome, nice work. Testing now |
@pashist With these changes, what are the paths of execution when js/css change? My concern is that there's a webpack-dev path going off triggered by changes and a nodemon task executing from the same changes, racing towards a livereload which may happen before or after webpack is built (and if I'm reading the webpack-dev stuff the nodemon restart isn't actually necessary in this case). |
@rjVapes basically files handled by webpack should not intersect with nodemon watched files, in nodemon config they are added to ignore section:
Even if same file will watched by webpack and nodemon, after changes triggered, nodemon will restart server.js with webpack-dev-middleware inside, so any webpack building process will interrupt and executed again after server.js start |
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.
Great work. Saving a frontend file in the past would sometimes require a manual call to webpack or restarting gulp or resaving the file due to the tomfoolery that rjvapes described with nodemon/livereload/webpack/gulp.
No race conditions, smart middleware, 75% faster bundle times and HMR support for those that dare go down that path -- wins all around
Great job Pavel. On Oct 28, 2016 21:42, "Tim Elfelt" notifications@github.com wrote:
|
One minor fix webpack.test.js to make SASS and svg etc work:
Other than that this looks good and I merged to my fork already, thanks again |
@pashist Ah, okay I didn't notice the ignore of packages/**/public. Does webpack-dev trigger a page reload on its own? I know I saw it was capable of it, but didn't notice any config changes to set it up explicitly. Also, since you're editing the gulp, @dalenguyen in the gitter chat recently mentioned that server side html files need a nodemon restart (I guess express caches them and I didn't realize) so we probably need to feed the |
added `--no-wdm` arg for disabling webpack dev middleware and using webpack task instead updated webpack test config linnovate#1696 (comment)
Regarding 26962b9. Since webpack-dev-middleware is an express server middleware, it will recompile bundle every time when nodemon restarts server due to server files changes. It's no problem if we currently develop public part. But if it's server part development, recompiling public files is unnecessary and @rjVapes perhaps we could just disable files |
@pashist So the issue is when nodemon restarts the process containing the webpack middleware, it loses the bundle information stored in memory, right? Two workarounds are either use a separate process for webpack middleware, or find a way to reload your server routes without restarting the whole process (this is maybe for next milestone?, essentially use webpack to generate server bundle and I'm good with a |
@pashist Sounds like a good solution (disabling .html cache). Any time lost from not having the small volume of server side html cached I'm sure would more than be made up by not having to reload the server. |
webpack dev middleware available with `--wdm` option
@pashist thoughts on rebasing and merging? |
@pashist @liorkesos can we get this merged? |
added `--no-wdm` arg for disabling webpack dev middleware and using webpack task instead updated webpack test config linnovate/mean#1696 (comment)
webpack-dev-middleware
. It enabled nice hot module replacement feature of webpack. Also hope it reduced rebuilding time.less
andsass
tasks. Instead usedless-loader
andsass-loader
for webpack with sourcemaps. Now.less
and.scss
files can be imported in packages.nodemon
.