forked from javascript-obfuscator/javascript-obfuscator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
60 lines (57 loc) · 1.48 KB
/
webpack.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
'use strict';
const fs = require("fs");
const nodeExternals = require('webpack-node-externals');
const webpack = require('webpack');
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;
function getLicenseText () {
return "/*\nCopyright (C) 2017 Timofey Kachalov <[email protected]>\n\n" +
fs.readFileSync('./LICENSE.BSD', 'utf8') + "\n*/";
}
module.exports = {
entry: {
'index': './index.ts'
},
devtool: 'source-map',
target: 'node',
externals: [nodeExternals()],
module: {
rules: [
{
enforce: 'pre',
test: /\.ts$/,
loader: 'tslint-loader',
exclude: /(node_modules)/
},
{
test: /\.ts(x?)$/,
loader: 'awesome-typescript-loader',
query: {
useBabel: true,
useCache: true
}
}
]
},
resolve: {
extensions: ['.ts']
},
plugins: [
new webpack.BannerPlugin(
{
banner: getLicenseText() + '\n\nrequire("source-map-support").install();\n',
raw: true,
entryOnly: false
}
),
new CheckerPlugin()
],
output: {
path: __dirname + '/dist',
filename: '[name].js',
libraryTarget: "commonjs2",
library: "JavaScriptObfuscator"
},
stats: {
maxModules: 0
}
};