This repository has been archived by the owner on Apr 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathwebpack.config.js
85 lines (77 loc) · 1.96 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
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
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable */
const path = require('path');
const webpack = require('webpack');
module.exports = {
context: path.resolve(__dirname),
entry: {
'fxa-client': './client/FxAccountClient',
'fxa-client.min': './client/FxAccountClient',
},
output: {
filename: '[name].js',
library: 'FxAccountClient',
libraryTarget: 'umd',
path: path.resolve(__dirname, 'build'),
publicPath: '/'
},
resolve: {
extensions: ['.js'],
modules: [
path.resolve(__dirname, 'client')
],
alias: {
'es6-promise': path.resolve(__dirname, 'node_modules/es6-promise/dist/es6-promise'),
sjcl: path.resolve(__dirname, 'node_modules/sjcl/sjcl')
}
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
output: {
comments: false
},
compress: {
unsafe_comps: true,
properties: true,
keep_fargs: false,
pure_getters: true,
collapse_vars: true,
unsafe: true,
warnings: false,
screw_ie8: true,
sequences: true,
dead_code: true,
drop_debugger: true,
comparisons: true,
conditionals: true,
evaluate: true,
booleans: true,
loops: true,
unused: true,
hoist_funs: true,
if_return: true,
join_vars: true,
cascade: true,
drop_console: true
},
sourceMap: true
})
],
node: {
global: true,
process: false,
Buffer: false,
__filename: false,
__dirname: false,
setImmediate: false
},
module: {},
stats: { colors: true },
// See https://webpack.js.org/configuration/devtool/ to
// configure source maps to personal preferences.
devtool: 'source-map'
};
/* eslint-enable */