-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
66 lines (59 loc) · 1.25 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
54
55
56
57
58
59
60
61
62
63
64
65
66
let path = require('path');
let webpack = require('webpack');
let fs = require('fs');
let sassLoader = [
'style-loader',
'css-loader',
'sass-loader?sourceMap=true&sourceMapContents=true&includePaths[]=' +
encodeURIComponent(path.resolve(__dirname, './src/styles')),
];
module.exports = {
devtool: 'inline-source-map',
mode: 'production',
performance: {
hints: false,
},
entry: {
index: './src',
vendors: ['react', 'react-dom'],
},
output: {
path: path.resolve(__dirname, 'build'),
filename: '[name].js',
publicPath: '/build/'
},
module: {
rules: [{
test: /\.tsx?$/,
include: [
path.resolve(__dirname, 'src'),
],
loader: 'awesome-typescript-loader'
}, {
test: /\.scss$/,
include: [
path.resolve(__dirname, 'src'),
],
use: sassLoader,
}, {
test: /\.css$/,
use: ['style-loader', 'css-loader?sourceMap']
}]
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json', '.scss', '.css', '.less'],
},
devServer: {
hot: true,
compress: true,
historyApiFallback: true,
headers: {
'Access-Control-Allow-Origin': '*'
},
stats: {
chunks: false,
},
host: "127.0.0.1",
port: 8080
},
};