-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
executable file
·45 lines (42 loc) · 1.04 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
let debug = process.env.NODE_ENV;
let webpack = require('webpack');
let path = require('path');
module.exports =
{
context: __dirname + "/src",
devtool: debug ? 'inline sourcemap': null,
entry: './tagger.js',
output:
{
path: __dirname,
filename: "tagger.min.js",
library: "Tagger",
libraryTarget: "umd"
},
module: {
loaders: [
{
loader: "babel-loader",
exclude: /node_modules/,
// Skip any files outside of your project's `src` directory
include: [
path.resolve(__dirname, ""),
],
// Only run `.js` and `.jsx` files through Babel
test: /\.js?$/,
// Options to configure babel with
query: {
presets: ['es2015'],
plugins: ['transform-runtime'],
plugins: ["add-module-exports"]
}
},
]
},
plugins: debug ? [
]:[
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin( {mangle: false, sourcemap: false} ),
],
}