-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
43 lines (39 loc) · 1.35 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
const path = require('path');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = function(env) {
env = env || { devMode: false };
const fileEntries = [
path.resolve(__dirname, 'src', env.devMode ? 'dev-settings.js' : 'prod-settings.js'),
path.resolve(__dirname, 'src', 'adsmurai-tracking.js')
];
const distPath = env.devMode
? path.resolve(__dirname, 'test', 'fixtures')
: path.resolve(__dirname, 'dist');
return [
{
name: 'full',
target: 'web',
devtool: env.devMode ? 'eval-source-map' : false,
entry: [path.resolve(__dirname, 'node_modules', 'fingerprintjs2', 'dist', 'fingerprint2.min.js')].concat(
fileEntries
),
output: {
filename: 'adsmurai-tracking.min.js',
path: distPath
},
plugins: [new UglifyJSPlugin()]
},
// Only for people who already use FingerprintJS2 on their own
{
name: 'lite',
target: 'web',
devtool: env.devMode ? 'eval-source-map' : false,
entry: fileEntries,
output: {
filename: 'adsmurai-tracking.lite.min.js',
path: distPath
},
plugins: [new UglifyJSPlugin()]
}
];
};