forked from javascript-obfuscator/javascript-obfuscator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
46 lines (42 loc) · 1.04 KB
/
webpack.config.js
File metadata and controls
46 lines (42 loc) · 1.04 KB
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
'use strict';
let fs = require("fs"),
nodeExternals = require('webpack-node-externals'),
webpack = require('webpack');
function getLicenseText () {
return `/*
Copyright (C) 2016 Timofey Kachalov <sanex3339@yandex.ru>
${fs.readFileSync('./LICENSE.BSD', 'utf8')}
*/`;
}
module.exports = {
entry: {
'index': './index.ts'
},
devtool: 'source-map',
target: 'node',
externals: [nodeExternals()],
module: {
loaders: [
{ test: /\.ts(x?)$/, loader: 'babel-loader!ts-loader' }
]
},
resolve: {
extensions: ['', '.ts'],
modulesDirectories: ['./src', './node_modules']
},
plugins: [
new webpack.BannerPlugin(
{
banner: `${getLicenseText()}\n\nrequire("source-map-support").install();\n`,
raw: true,
entryOnly: false
}
)
],
output: {
path: './dist',
filename: '[name].js',
libraryTarget: "commonjs2",
library: "JavaScriptObfuscator"
}
};