vue-cli-plugin-javascript-obfuscator 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generator.js +7 -0
- package/index.js +0 -23
- package/package.json +1 -1
package/generator.js
ADDED
package/index.js
CHANGED
|
@@ -2,25 +2,6 @@
|
|
|
2
2
|
const JavaScriptObfuscator = require('javascript-obfuscator')
|
|
3
3
|
|
|
4
4
|
module.exports = (api) => {
|
|
5
|
-
// Automatically install javascript-obfuscator@4.x when the plugin is added
|
|
6
|
-
api.extendPackage({
|
|
7
|
-
devDependencies: {
|
|
8
|
-
'javascript-obfuscator': '^4.0.0' // Automatically add version 4.x
|
|
9
|
-
}
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
// Inject a feature for the plugin
|
|
13
|
-
api.injectFeature({
|
|
14
|
-
name: 'javascript-obfuscator',
|
|
15
|
-
description:
|
|
16
|
-
'A plugin to obfuscate JavaScript files using javascript-obfuscator',
|
|
17
|
-
enabled: true
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Vue CLI chainWebpack hook to apply the JavaScript Obfuscator plugin.
|
|
22
|
-
* @param {object} config - The Webpack configuration object.
|
|
23
|
-
*/
|
|
24
5
|
api.chainWebpack((config) => {
|
|
25
6
|
// Get user-configured options from vue.config.js
|
|
26
7
|
const options =
|
|
@@ -36,10 +17,6 @@ module.exports = (api) => {
|
|
|
36
17
|
: [options.excludes || []]
|
|
37
18
|
const obfuscatorOptions = options.obfuscatorOptions || {}
|
|
38
19
|
|
|
39
|
-
/**
|
|
40
|
-
* Webpack plugin that obfuscates JavaScript assets.
|
|
41
|
-
* @param {object} compiler - Webpack compiler instance
|
|
42
|
-
*/
|
|
43
20
|
function JavascriptObfuscatorPlugin(compiler) {
|
|
44
21
|
compiler.hooks.emit.tapAsync(
|
|
45
22
|
'JavascriptObfuscatorPlugin',
|