-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
40 lines (36 loc) · 1.07 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
const webpack = require("webpack");
const path = require('path');
module.exports = {
entry: {
popup: path.join(__dirname, 'src/popup.ts'),
options: path.join(__dirname, 'src/options.ts'),
content_script: path.join(__dirname, 'src/content_script.ts'),
background: path.join(__dirname, 'src/background.ts'),
vendor: ['moment', 'jquery']
},
output: {
path: path.join(__dirname, 'dist/js'),
filename: '[name].js'
},
module: {
loaders: [{
exclude: /node_modules/,
test: /\.tsx?$/,
loader: 'ts-loader'
}]
},
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
plugins: [
// pack common vender files
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity
}),
// exclude locale files in moment
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
// minify
// new webpack.optimize.UglifyJsPlugin()
]
};