-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
75 lines (71 loc) · 2.18 KB
/
webpack.config.js
File metadata and controls
75 lines (71 loc) · 2.18 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
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
var webpack = require('webpack');
var path = require('path');
var WebpackNotifierPlugin = require('webpack-notifier');
var BUILD_DIR = path.resolve(__dirname, 'public/js');
var APP_DIR = path.resolve(__dirname, 'resources/assets/scripts');
var config = {
cache: true,
devtool: 'eval',
//devtool: 'cheap-module-source-map',
entry: {
popup: [
APP_DIR + '/contract/annotator/annotator.plugin.event.js',
APP_DIR + '/contract/annotator/annotator.plugin.viewer.js',
APP_DIR + '/contract/annotator/pdf-annotator.js',
APP_DIR + '/popup/index.js',
],
app: [
APP_DIR +'/script.js'
],
contract_view: [
APP_DIR + '/contract/annotator/annotator.plugin.event.js',
APP_DIR + '/contract/annotator/annotator.plugin.viewer.js',
APP_DIR + '/contract/annotator/pdf-annotator.js',
APP_DIR + '/contract/index.js'
],
clipping: [
APP_DIR + '/contract/clip/main.js'
]
},
output: {
path: BUILD_DIR,
filename: '[name].js'
},
module: {
loaders: [
{
test: /[\.js?$|\.jsx?$]/,
include: APP_DIR,
exclude: /node_modules/,
loader: 'babel',
query: {
cacheDirectory: true, //important for performance
plugins: ["transform-regenerator"],
presets: ["react", "es2015", "stage-0"]
}
}
]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {warnings: false},
minimize: true,
output: {
comments: false
}
}),
new WebpackNotifierPlugin({title: 'Webpack'}),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
})
]
};
module.exports = config;