electron-ecrypted-webpack-plugin
v0.1.1
Published
electron-ecrypted-webpack-plugin for webpack
Downloads
1
Maintainers
Readme
electron-ecrypted-webpack-plugin
const NodeRSA = require('node-rsa')
const EcryptedBuildPlugin = require('electron-ecrypted-webpack-plugin')
const key = new NodeRSA({ b: 512 })
const privateKey = process.env.VUE_APP_CODE_PRIVATE_KEY
if (!privateKey) throw new Error('VUE_APP_CODE_PRIVATE_KEY not found')
key.importKey(privateKey, 'private')
function doEcrypted(input) {
return key.encryptPrivate(input, 'hex')
}
let plugins = [
new EcryptedBuildPlugin({
ecryptedFn: doEcrypted,
}),
]
// webpack config plugins