-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebpack.config.js
36 lines (35 loc) · 1.09 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
const path = require('path');
const webpack = require('webpack');
const package = require('./package');
module.exports = {
entry: {
'rest-resource': './dist/index.js',
'rest-resource.min': './dist/index.js'
},
output: {
path: path.resolve(__dirname, 'dist/dom'),
filename: '[name].js',
library: 'Resource',
libraryTarget: 'var',
libraryExport: 'default'
},
devtool: 'source-map',
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: [require.resolve('babel-preset-es2015')]
}
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
compress: { warnings: false }
}),
new webpack.BannerPlugin(`REST Resource\n${package.repository.url}\n\n@author ${package.author}\n@link ${package.link}\n@version ${package.version}\n\nReleased under MIT License. See LICENSE.txt or http://opensource.org/licenses/MIT`)
]
}