-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
51 lines (48 loc) · 1.31 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
var path = require('path');
var HtmlWebpackPlugin = require("html-webpack-plugin");
var SRC_DIR = path.resolve(__dirname, 'src');
var config = {
entry: SRC_DIR + '/index.js',
output: {
path: SRC_DIR,
filename: 'app.min.js'
},
devServer: {
host: '0.0.0.0',
port: 3100,
https: true,
disableHostCheck: true,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET,PUT,POST,DELETE,PATCH,OPTIONS'
}
},
module: {
rules: [
{
test: /\.js$/,
include: SRC_DIR,
exclude: /(node_modules)/,
loader: 'babel-loader',
query: { presets: ['es2015', 'react'], plugins: ["transform-decorators-legacy", "transform-class-properties"] }
},
{
test: /\.scss|css$/,
use: [
"style-loader",
"css-loader",
"postcss-loader",
"resolve-url-loader",
"sass-loader?sourceMap"
]
}
]
},
plugins: [
new HtmlWebpackPlugin({
hash: false,
template: "./src/index.html"
})
]
};
module.exports = config;