-
Notifications
You must be signed in to change notification settings - Fork 832
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
workbox-webpack-plugin is not writing in MemoryFS in development environment #577
Comments
@sridharAJ, the current webpack plugin acts on Few questions:
|
@prateekbh Thanks for your quick reply.
|
cool, i'll take that as an input, btw |
@prateekbh Is there any quick workaround for now, So that i can continue my development. |
@sridharAJ i am not sure if there is a workaround for the memoryFS bug. |
@prateekbh |
@jeffposnick correct me if I am wrong, but |
|
@jeffposnick and @prateekbh Any update on this? |
I ran into this issue as well. As this is a much used way of working with webpack, it would be nice to have a fix. |
I'm on my phone but would be good to ask Sean Larkin if he has any examples of plugins that do this. |
@TheLarkInn Are you aware of how we might solve this issue? Any examples / guidance would be greatly appreciated. |
So I checked that eve |
webpack-dev-server doesn't write anything to disk. |
I'm happy to make changes to workbox-build if someone can explain what is needed to get this working, maybe @goldhand has some ideas. |
@gauntface , is there a way to specify the filepaths without the files existing on the file system yet? We can be certain that files will exist after webpack emits them, but we can't write to fliesystem, generate the service worker using the filepaths, then pass it back to webpack because webpack's cycle has already ended after it wrote to the filesystem the first time. I think this would be the first step to emitting the service worker as a webpack asset, rather than writing it in the plugin. |
@goldhand Yup, there's now support for a There's some context about using it for supporting (I'm not convinced that aggressively precaching in a dev server is actually desirable, but I'm not the target audience and enough other people have asked for it that I'm willing to accept it.) |
If anyone gets a chance to try this would appreciate feedback or issues. |
What about this part of the issue :
Is there a way to have a native support for dev env ? like copy-webpack-plugin for example which depends on webpack's in-memory filesystem in dev. |
We are also in need for WorkBox support in development mode where files are written to memory and not to the filesystem. |
I think we have a solution for this. I haven't tested with webpack-dev-server but I'm using webpack to generate a manifest and adding it to the compilation assets. |
Excellent news @goldhand ! |
Let me know if ya'll need any help in regards to the memory-fs realm. Most of the time webpack just swaps out the abstraction for compiler.inputFileSystem and compiler.outputFileSystem |
Hey @TheLarkInn! I see, so if we use I've been just inserting service worker stuff into the compilation.assets[manifestFilename] = {
size: () => manifest.length,
source: () => manifest,
}; This is working pretty well (when I've been testing with dev-server too). |
#808 does everything in-memory and should fix this. I've used it with webpack-dev-server successfully. |
@goldhand Yes that is correct. Unless your plugin has specific alt-fs needs, you should just be fine hooking into the existing fs. |
after adding this to my webpack config, I succeded in making my development environement to work: My package.json: my webpack.config.js
|
Any update on this issue? |
@jegj we are working on it. No ETA yet. |
FYI, this is supported in the #808 pr. It's not ready for merging yet though |
Now that #808 has landed, sgtm to close this one. |
Library Affected:
workbox-webpack-plugin
Browser & Platform:
all browsers.
Issue or Feature Request Description:
I am using webpack as my build tool. When I am using workbox-webpack-plugin in development mode, the service worker file is not stored in webpack Memory FileSystem and referring all the static assets from disk instead of memory. Because of this I am not able to use workbox in development mode. And need some example for workbox-sw with webpack in development environment.
The text was updated successfully, but these errors were encountered: