forked from GrapesJS/components-countdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
38 lines (36 loc) · 864 Bytes
/
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
var path = require('path');
var webpack = require('webpack');
var pkg = require('./package.json');
var name = 'grapesjs-component-countdown';
var env = process.env.WEBPACK_ENV;
var plugins = [];
if (env !== 'dev') {
plugins.push(new webpack.optimize.UglifyJsPlugin({ compressor: { warnings: false } }));
plugins.push(new webpack.BannerPlugin(pkg.name + ' - ' + pkg.version));
}
module.exports = {
entry: './src',
output: {
filename: './dist/' + name + '.min.js',
library: name,
libraryTarget: 'umd',
},
module: {
loaders: [
{
enforce: 'pre',
test: /\.json$/,
loader: 'json'
},{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
include: /src/,
query: {
presets: ['es2015']
}
},
],
},
plugins: plugins
};