HTML file not load `index.js` when in Multiple Pages mode
See original GitHub issueversion: 2.0.0-rc.6
After running yarn electron:serve
, HTML file does not load index.js
when in Multiple Pages mode.
Alaways reproduce when checking with browser or electron (browser sreenshot).

while after running yarn serve
, everything goes fine (browser sreenshot):

Here is my vue.config.js
file:
const path = require('path');
const webAppEntry = 'src/drivers/ui/web/main.ts';
const alias = {
entity: path.resolve(__dirname, 'src/domain/entity'),
service: path.resolve(__dirname, 'src/domain/service'),
repository: path.resolve(__dirname, 'src/domain/repository'),
drivers: path.resolve(__dirname, 'src/drivers'),
};
module.exports = {
pages: {
index: {
entry: webAppEntry,
template: 'src/drivers/ui/web/public/index.html',
},
},
configureWebpack: {
resolve: { alias },
},
pluginOptions: {
electronBuilder: {
chainWebpackMainProcess: config => {
Object.keys(alias).forEach(key => {
config.resolve.alias.set(key, alias[key]);
});
},
// @see https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/578#issuecomment-561972824
externals: ['sequelize'],
mainProcessFile: 'src/drivers/ui/electron/main.ts',
rendererProcessFile: webAppEntry,
mainProcessWatch: ['src/drivers/ui/electron/*'],
mainProcessArgs: ['--arg-name', 'arg-value'],
},
},
};
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How do you import multiple javascript files in HTML index file ...
7 Answers 7 · Add the following function in your web page. function loadScript(url) { var head = document.getElementsByTagName('head')[0]; var script = document....
Read more >Tips for authoring fast-loading HTML pages - MDN Web Docs
These tips are based on common knowledge and experimentation.
Read more >Static website, multiple html pages, using Webpack + example ...
Above we are reusing index.js file in every page with chunks: ['index'] to change this just add new Javascript files about.js ...
Read more >Make multipage HTML development suck less with Pug
Create an app.js in the src/ folder. It can be blank. Doesn't matter. It also needs an initial pug file to compile. Create...
Read more >Multiple Pages - SurviveJS
Go through the multi-compiler mode and return an array of configurations. The approach would work as long as the pages are separate, and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think I’ll just remove it completely in favor of changing it through
pages.index.entry
in v3.Try removing the
rendererProcessFile
config from yourvue.config.js
. If that doesn’t work, I’m going to need a repo that demonstrates the error as I can’t replicate it myself. You can see https://github.com/nklayman/electron-multipage-example/ for an example as well.