-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
45 lines (43 loc) · 1007 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
39
40
41
42
43
44
45
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CleanPlugin = require('clean-webpack-plugin');
var PATHS = {
src: path.join(__dirname, 'src'),
dist: path.join(__dirname, 'dist'),
template: path.join(__dirname, 'html-webpack-template/index.ejs')
};
module.exports = {
entry: {
src: PATHS.src
},
devtool: 'source-map',
output: {
path: PATHS.dist,
filename: 'dragform.min.js',
libraryTarget: 'umd',
library: 'DragForm'
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
}),
new HtmlWebpackPlugin({
template: PATHS.template,
title: 'dragform',
appMountId: 'dragform',
inject: false
}),
new CleanPlugin([PATHS.dist], {
verbose: false
})
],
module: {
loaders: [
{test: /\.coffee/, loader: "coffee"}
]
},
resolve: {
extensions: ["", ".web.coffee", "web.js", ".coffee", ".js"]
}
};