-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
executable file
·53 lines (50 loc) · 1.22 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
48
49
50
51
52
53
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const publicPath = (mode) => {
if (mode === 'production')
return '/redux-reactstrap-modal/';
return '/';
};
module.exports = (env, { mode = 'production' }) => ({
mode,
devtool: 'eval-source-map',
entry: path.join(__dirname, 'examples', 'index.js'),
output: {
path: path.join(__dirname, 'build'),
publicPath: publicPath(mode),
filename: 'index.js'
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: ['babel-loader']
}, {
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.svg/,
use: ["svg-url-loader"]
}
]
},
plugins: [new HtmlWebpackPlugin({
inject: true,
template: require('html-webpack-template'),
appMountId: 'app',
title: 'My App',
mobile: true,
lang: 'en-US',
})
],
devServer:{
open:true,
inline:true,
hot:true
}
});