How to require.ensure a chunk from memory-fs in webpack?

房东的猫 提交于 2019-12-11 06:39:48

问题


Let's say I have a webpack configuration uses memory-fs as outputFileSystem and the target is node. And somewhere in the code I use require.ensure to split the code. In this case, when I try to require the module it tries to find the module in the disk and throws a "module not found error". What I want is, require to load split module from memory-fs as well. I couldn't find any appropriate loader or plugin fits this case. So, I will create my own. But I couldn't decide if I need a webpack plugin or a loader?

Thanks

来源:https://stackoverflow.com/questions/39506990/how-to-require-ensure-a-chunk-from-memory-fs-in-webpack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!