Open ashokgelal opened 7 years ago
Do you have "postinstall": "electron-webpack dll" ?
Maybe you use custom HTML?
Yes I do have "postintall": "electron-webpack dll"
Also, now I'm getting a different error when I run electron-webpack dll:
Error: DllPlugin: supply an Array as entry Similar to this: https://github.com/chentsulin/electron-react-boilerplate/issues/1199
I have the same issue.
Debugging it, I found that in webpack/lib/DLLPlugin
(webpack@3.6.0
), there is this code:
compiler.plugin("entry-option", (context, entry) => {
function itemToPlugin(item, name) {
if(Array.isArray(item))
return new DllEntryPlugin(context, item, name);
else
throw new Error("DllPlugin: supply an Array as entry");
}
if(typeof entry === "object" && !Array.isArray(entry)) {
Object.keys(entry).forEach(name => {
compiler.apply(itemToPlugin(entry[name], name));
});
} else {
compiler.apply(itemToPlugin(entry, "main"));
}
return true;
});
EDIT:
Logging via console.log('DllPlugin', {item})
inside function itemToPlugin(item, name)
we can see this:
DllPlugin { item: [ 'classnames', 'autobind-decorator' ] }
DllPlugin { item: 'dll' }
The problem is that dll
ends up in there as a string, which is not an array..
This is probably due to entry
coming in as { vendor: [ 'classnames', 'autobind-decorator' ], main: 'dll' }
As per your suggestion, I'm using dll to improve the build time but I get Uncaught ReferenceError: vendor is not defined error every time. With my experience with
Laravel Mix
I understand that I need to load the generatedvendor.js
file in dist/render-dll directoy but couldn't figure out how. I thought that this was automated and gets injected by electron-webpack.I'm using electron-vue and my package.json looks something like this:
Thanks for your help.