Problem with electron-webpack integration
See original GitHub issueI have some very similar problems with integrating bootstrap-vue with electron-webpack.
The interesting this is that this error only happens if I use the code with electron-webpack. I use bootstrap-vue without any problem in my vue project, but as soon as I put the code under electron-webpack, I get this error.
If I switch back the version to 2.0.0-rc.15, then the error disappears.
However, in both cases with electron-webpack the styles somewhy do not get applied. Again, in a simple vue project, everything is fine. Under electron-webpack, I get the error with the latest version AND I got not styling.
I have a webpack config in package.json:
...
"electronWebpack": {
"main": {
"webpackConfig": "webpack.config.js"
}
}
and in the webpack.config.js:
module.exports = {
"resolve": {
"alias": {
"vue": "vue/dist/vue.runtime.esm.js" // yes, I need the runtime
}
}
}
Any idea?
If I check the electron’s html in the debugger, I see no styles for bootstrap inserted.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top GitHub Comments
@mudlee
shouldn’t that be the “renderer” config instead of the the “main”? I guess Vue is only used in the renderer process…?
Update: I just read the docs and you need it for both renderer and main process.
However, since you’re using
electron-webpack
, if all you need is the alias, you don’t need custom configs at all, aselectron-webpack
does it automatically for vue project.The issue with missing styles has nothing to do with
bootstrap-vue
- it is purely anelectron-webpack
problem (caused by my humble self…) and it’s fixed in version 2.7.2.Please see https://github.com/electron-userland/electron-webpack/issues/302#issuecomment-508911966
In summary, I suggest this issue be closed, as it really is not an issue of
bootstrap-vue
.The CSS issue isn’t related to the multiple vue instances.
I think electron makes some assumptions about libraries and that all styles associated with a component are scoped styles (part of a SFC file), which is not the case with BootstrapVue
Or there might be a special way that electron needs the CSS loaded. It shouldn’t be mangling the Bootstrap v4.x class names