vue-cli-plugin-electron-builder
vue-cli-plugin-electron-builder copied to clipboard
bakcground.js has no sourcemaps
I am trying to use sentry with the sourcemaps, the rendering works fine but the main process does not work. It seems that no sourcemap is generated for the background.js file, they are only generated for the main.js files.
Hey,
I haven't properly tested yet, but this seems to generate sourceMaps for background.js
// vue.config.js
pluginOptions: {
electronBuilder: {
chainWebpackMainProcess: (config) => {
config.devtool('source-map')
},
@nicolas-t Hey, thanks for posting this, I've tried it but it's still not adding source maps for background.js and other scripts included from that one. If it helps here's my vue.config.js file:
const path = require("path");
module.exports = {
lintOnSave: false,
transpileDependencies: ["vuetify"],
pluginOptions: {
electronBuilder: {
preload: "src/preload.js",
externals: ["serialport"],
outputDir: "builds",
chainWebpackMainProcess: (config) => {
config.devtool('source-map')
},
},
},
configureWebpack: {
devtool: 'source-map',
resolve: {
alias: {
"@": path.resolve(__dirname, "src/"),
},
},
},
css: {
loaderOptions: {
sass: {
additionalData: '@import "~@/assets/style/_variables.scss"',
},
},
},
};
Do you have any other suggestions? Thanks in advance if you look into this.
How about https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/recipes.html#enable-sourcemaps?
@MatthijsBurgh Thanks for replying. I already have that, you can see in the config I've posted.
This is also what can be found in all Vue docs, so I can't help you further. Good luck.
Hey,
I haven't properly tested yet, but this seems to generate sourceMaps for background.js
// vue.config.js pluginOptions: { electronBuilder: { chainWebpackMainProcess: (config) => { config.devtool('source-map') },
good job