nklayman / vue-cli-plugin-electron-builder

Easily Build Your Vue.js App For Desktop With Electron
https://nklayman.github.io/vue-cli-plugin-electron-builder/
MIT License
4.12k stars 280 forks source link

Is there any way to remove this source code in chrome/source/page? #1862

Closed aquarius-wing closed 1 year ago

aquarius-wing commented 1 year ago

Hi, I get this problem: how to remove this?

CleanShot 2022-10-26 at 17 18 14@2x

This will expose my some typescript code in production mode.

Thanks.

MatthijsBurgh commented 1 year ago

I have no clue. I think this is a question for electron-builder.

aquarius-wing commented 1 year ago

I copy the link of file, which start with "webpack://" Is there prossable the vue cli start the webpack dev server, and in the electron production, it still start the server?

MatthijsBurgh commented 1 year ago

Could please provide a bit more context. Too much information is much preferred over no/too less information.

aquarius-wing commented 1 year ago

Thanks for reply, here is my repository.

electron-demo2

just run these command

npm install
npm run electron:build

and install the app from dist_electron.

Open it you will get this below:

CleanShot 2022-10-26 at 19 44 12@2x

The key problem is, no matter how encrypted and confused the code, the source code specially the typescript file, will display directaly.

JunzheFan commented 1 year ago

even though you can see the source code in the chrome development tool, but in production mode the dev tool is not visible to the users, is there any way you can force that dev tool to open during production?

aquarius-wing commented 1 year ago

even though you can see the source code in the chrome development tool, but in production mode the dev tool is not visible to the users, is there any way you can force that dev tool to open during production?

I just want know is there any way to remove this, because my app is in the internel test stage now, so I need my user can open the devtool so help my find the bug....

aquarius-wing commented 1 year ago

I finnally understand how to fix.Just add this config:

module.exports = defineConfig({
  productionSourceMap: false,
  //...
})

Why is this setting defaulted to true? Who would want a source map in a production environment? I'm quite confused...