forked from marmelab/restful.js
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
31 lines (30 loc) · 857 Bytes
/
webpack.config.js
File metadata and controls
31 lines (30 loc) · 857 Bytes
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
/* eslint-disable no-var */
var webpack = require('webpack');
var production = process.env.NODE_ENV === 'production';
module.exports = {
entry: {
restful: './build/restful.standalone.js',
'restful.standalone': './build/restful.fetch.js',
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
}],
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
].concat(production ? [
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.DedupePlugin(),
] : []),
output: {
path: './dist',
filename: production ? '[name].min.js' : '[name].js',
library: 'restful',
libraryTarget: 'umd',
},
};