Error with dll: Error: Can't resolve './vendor.js' in dist
- Version: 2.8.2
After compiling dll and trying to start the dev server, this error happens:
ERROR in ./dist/.renderer-index-template.html (./node_modules/html-loader/dist/cjs.js?minimize=false!./dist/.renderer-index-template.html)
Module not found: Error: Can't resolve './vendor.js' in '/foo/bar/dist'
@ ./dist/.renderer-index-template.html (./node_modules/html-loader/dist/cjs.js?minimize=false!./dist/.renderer-index-template.html) 3:33-55
This issue happens because the vendor.js is writting into dist/renderer-dll/vendor.js, but inside /dist/.renderer-index-template.html it is imported without any path.
Issue #155 and pull request #173 addressed this issue already some years ago, but in the meantime html-loader seem to removed the url parameter which fixed this issue back then.
When changing RendererTarget.js from
scripts.push(`<script type="text/javascript" src="${asset}"></script>`);
// to
scripts.push(`<script type="text/javascript" src="renderer-dll/${asset}"></script>`);
the compilation works, but then it looks like that HtmlWebpackCompiler or some other module is changing the src="..." to src="[object Object"] which is obviously an error.
For me the whole dll functionality is broken.
Bumping this issue as I'm having the same problem -- For some reason the vendor.js file in renderer-dll directory is not being given the correct path by the renderer-index-template.html
Same issue for me