This repository has been archived by the owner on Dec 5, 2022. It is now read-only.
/
webpack.main.config.js
94 lines (92 loc) · 2.76 KB
/
webpack.main.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
const webpack = require('webpack')
const path = require('path')
const rules = require('./webpack.rules')
const Dotenv = require('dotenv-webpack');
const WebpackObfuscator = require('webpack-obfuscator');
module.exports = {
entry: path.resolve(__dirname, 'src/main.js'),
module: {
rules: rules.rulesProd,
},
externals: {
'fs-extra': 'commonjs2 fs-extra',
},
devtool:'source-map',
devServer:{
historyApiFallback: true
},
resolve: {
extensions: ['*', '.js', '.jsx']
},
plugins: [
new Dotenv(),
/*new WebpackObfuscator ({
compact: true,
identifierNamesGenerator: 'hexadecimal',
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.75,
rotateStringArray: true,
target:'browser',
debugProtection: false,
disableConsoleOutput: false,
reservedStrings:['tmi.js', 'utf-8-validate', 'bufferutil', './lang/it.json', './lang/en.json', 'app.css'],
renameGlobals: true,
renameProperties: true,
stringArray: true,
shuffleStringArray: true,
deadCodeInjection: true,
deadCodeInjectionThreshold: 1,
debugProtection: false,
debugProtectionInterval: false,
disableConsoleOutput: false,
log: false,
numbersToExpressions: true,
optionsPreset: 'default',
}, [])*/
//
],
target: 'electron-main',
node: {
global: false,
__filename: false,
__dirname: false,
}
}
/**
* Reference for the obfuscator
* compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.75,
deadCodeInjection: true,
deadCodeInjectionThreshold: 1,
debugProtection: false,
debugProtectionInterval: false,
disableConsoleOutput: false,
domainLock: [],
identifierNamesGenerator: 'hexadecimal',
identifiersDictionary: [],
identifiersPrefix: '',
inputFileName: '',
log: false,
numbersToExpressions: true,
optionsPreset: 'default',
renameGlobals: true,
renameProperties: true,
reservedNames: [],
reservedStrings: [],
rotateStringArray: true,
seed: 0,
selfDefending: false,
shuffleStringArray: true,
simplify: true,
splitStrings: false,
splitStringsChunkLength: 10,
stringArray: true,
stringArrayEncoding: [],
stringArrayWrappersCount: 1,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersType: 'variable',
stringArrayThreshold: 0.75,
target: 'browser',
unicodeEscapeSequence: false
*/