forked from GrapesJS/grapesjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
44 lines (41 loc) · 1.02 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
//webpack --display-reasons
//Remove jquery https://github.com/webpack/webpack/issues/1275
var webpack = require('webpack');
var pkg = require('./package.json');
var env = process.env.WEBPACK_ENV;
var name = 'grapes';
var plugins = [];
if(env !== 'dev'){
plugins = [
new webpack.optimize.UglifyJsPlugin({
//sourceMap: true,
minimize: true,
compressor: {warnings: false},
}),
new webpack.BannerPlugin(pkg.name + ' - ' + pkg.version),
//v2 new webpack.BannerPlugin({banner: 'Banner v2'});
]
}
plugins.push(new webpack.ProvidePlugin({_: 'underscore'}));
module.exports = {
entry: './src',
output: {
filename: './dist/' + name + '.min.js',
library: 'grapesjs',
libraryTarget: 'umd',
},
externals: {jquery: 'jQuery'},
plugins: plugins,
module: {
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
include: /src/,
exclude: /node_modules/,
query: {presets: ['es2015']}
}],
},
resolve: {
modules: ['src', 'node_modules'],
},
}