forked from s0ber/vtree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
47 lines (45 loc) · 992 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
46
47
const path = require('path')
const webpack = require('webpack')
const UnminifiedWebpackPlugin = require('unminified-webpack-plugin')
const isProduction = process.env.NODE_ENV === 'production'
const plugins = []
const externals = []
if (isProduction) {
plugins.push(
new webpack.optimize.UglifyJsPlugin({minimize: true}),
new UnminifiedWebpackPlugin()
)
externals.push('jquery')
}
module.exports = {
devtool: 'source-map',
entry: ['./src/vtree'],
output: {
path: path.resolve('./build'),
filename: 'vtree.min.js',
library: 'Vtree',
libraryTarget: 'umd'
},
resolve: {
root: process.cwd(),
modulesDirectories: ['node_modules'],
extensions: ['', '.js', '.coffee', '.ejs']
},
module: {
loaders: [
{
test: /\.coffee$/,
loaders: ['coffee']
},
{
test: /\.ejs$/,
loaders: ['ejs']
}
]
},
plugins: plugins,
externals: externals,
devServer: {
stats: 'errors-only'
}
}