19 lines
482 B
JavaScript
19 lines
482 B
JavaScript
|
const EncryptPlugin = require('webpack-encrypt-plugin');
|
||
|
module.exports = {
|
||
|
configureWebpack: {
|
||
|
plugins: [
|
||
|
new EncryptPlugin({
|
||
|
// 加密规则,可以是一个对象,指定加密算法等
|
||
|
algorithm: 'aes-256-cbc',
|
||
|
// 需要加密的文件路径
|
||
|
test: /\.(js|css)$/i,
|
||
|
// 加密密钥
|
||
|
key: 'shaiyatong-encryption-key',
|
||
|
// 加密输入的字符串
|
||
|
inputEncoding: 'utf8',
|
||
|
// 加密输出的字符串
|
||
|
outputEncoding: 'hex',
|
||
|
})
|
||
|
]
|
||
|
}
|
||
|
}
|