1.0.7 • Published 3 years ago
encodekey v1.0.7
Purpose
Package and encrypt the key in Env and decrypt it in logic.
Method of use
// encode in webpack.dev.conf.js
const { KeyEncodePlugin } = require('encodeKey')// Introduction method
new KeyEncodePlugin({
keyName: env.BASE_ekey, // Set the variables that need to be encrypted
jsReg: /app\..+\.js$/, // Match file
assetsPath: '../../dist/static/js' // Set target directory
}),
// decode in project
import { decodeKey } from 'encodekey' // Introduction method
let key = decodeKey(process.env.BASE_ekey) // decryption key