forked from mcjohnalds/react-table-drag-select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
42 lines (41 loc) · 946 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
var webpack = require('webpack');
var HTMLWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './example/entry.js',
output: {
path: __dirname + '/docs',
filename: 'bundle.js'
},
devtool: 'source-map',
devServer: {
disableHostCheck: true
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/, // TODO: Do I need this line?
use: 'babel-loader'
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
},
plugins: [
// Make NODE_ENV available to js
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
new HTMLWebpackPlugin({title: 'react-table-drag-select demo'})
].concat(process.env.NODE_ENV === 'production' ?
[
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
] : []
)
};