forked from hiproxy/hiproxy-plugin-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
47 lines (45 loc) · 1.16 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
37
38
39
40
41
42
43
44
45
46
47
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './src/app.js',
output: {
filename: 'bundle.js',
path: path.resolve('./dist')
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react'],
plugins: []
},
exclude: /(node_modules|bower_components)/
},
{
test: /\.less$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'less-loader']
})
}
]
},
plugins: [
new ExtractTextPlugin('app.css'),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
})
],
resolve: {
extensions: ['.js', '.jsx'],
alias: {
"react": __dirname + "/source/scripts/react.min.js",
"redux": __dirname + "/source/scripts/redux.min.js",
"react-dom": __dirname + "/source/scripts/react-dom.min.js",
"react-redux": __dirname + "/source/scripts/react-redux.min.js"
}
}
};