You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed after killing ./bin/webpack-dev-server and refreshing your browser the packs it's generating were no longer findable. This is due to the fact that the webpack dev server serves the files from memory and never writes to disk.
This modified bundle is served from memory at the relative path specified in publicPath (see API). It will not be written to your configured output directory. Where a bundle already exists at the same URL path, the bundle in memory takes precedence (by default).
I'm kind of surprised the gem doesn't recognize the packs haven't actually been generated and attempt to generate them whenever its auto-compiling if the webpack-dev-server isn't running. Is there something I'm missing? Using the plugin I mentioned above works, but seems undocumented here.
The text was updated successfully, but these errors were encountered:
@cjstewart88 You could use watcher ./bin/webpack --watch --progress --colors that will write to file system and turn off the on demand compilation if using watcher from config/webpacker.yml (compile: false). Webpack dev server is meant to serve from memory.
I'm having the same problem. I've created a repo to reproduce the issue here. Steps to reproduce are in the README. The problem is if I run ./bin/webpack-dev-server everything's fine, but then if I stop using the dev server, the packs are no longer served correctly behind the scenes. A manifest gets written with a pack to serve but the pack itself doesn't get generated. Running ./bin/webpack-dev-server again fixes the issue, but would like the option to use or not use the dev server depending on my workflow at the time.
Also rm -rf public/packs fixes this issue temporarily. If I run the dev server again and quit it after doing this, then the problem resurfaces.
Problem
I noticed after killing
./bin/webpack-dev-server
and refreshing your browser the packs it's generating were no longer findable. This is due to the fact that the webpack dev server serves the files from memory and never writes to disk.via: https://webpack.github.io/docs/webpack-dev-server.html
Solution
I found an old issue(webpack/webpack-dev-server#62) that lead me to a plugin(https://github.com/gajus/write-file-webpack-plugin) that writes the packs to disk which will allow them to be served after the webpack-dev-servers killed.
My Confusion and Question
I'm kind of surprised the gem doesn't recognize the packs haven't actually been generated and attempt to generate them whenever its auto-compiling if the webpack-dev-server isn't running. Is there something I'm missing? Using the plugin I mentioned above works, but seems undocumented here.
The text was updated successfully, but these errors were encountered: