virtual-module-webpack-plugin
virtual-module-webpack-plugin copied to clipboard
Can I use virtual module as entry point?
const webpackConfig = {
entry: "/path/to/virtual/file/module.js",
plugins:[
new VirtualModulePlugin({
moduleName: "/path/to/virtual/file/module.js",
contents: `// here is the javascript code`
})
]
}
I try it in webpack@4, It seem not work
ERROR in Entry module not found: Error: Can't resolve '/path/to/virtual/file/module.js' in 'xxx'
Ok. I haven’t tried that before. I should test it with webpack 2 to see if it has ever worked with this plugin. Let me know if you get a chance - should be easy to modify the example for webpack-2 in here to test. Thanks.
Here is the relative issue https://github.com/webpack/webpack/issues/6437
I have try it in entry point, and it didn't work.
It works for webpack 3, but broken since webpack 4.
has plan to fix this in webpack4 ?
fyi: This plugin works for me with Webpack 4: webpack-virtual-modules