-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack-dev.config.js
More file actions
executable file
·82 lines (76 loc) · 2.02 KB
/
webpack-dev.config.js
File metadata and controls
executable file
·82 lines (76 loc) · 2.02 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const path = require('path')
const webpack = require('webpack')
module.exports = {
mode: 'development',
entry: './src/index.tsx',
devtool: 'inline-source-map',
module: {
rules: [
{
test: /(\.ts|\.tsx)/,
loader: 'ts-loader',
include: [path.resolve(__dirname, 'src')],
exclude: [path.resolve(__dirname, 'node_modules')],
},
{
test: /\.scss$/,
use: [
'style-loader',
'css-modules-typescript-loader',
{
loader: 'css-loader',
options: {
sourceMap: true,
modules: {
mode: 'local',
localIdentName: '[local]___[hash:base64:5]',
},
},
},
'sass-loader',
],
},
{
test: /\.(png|jpg|jpeg|gif|svg|pdf)$/,
loader: 'url-loader',
options: {
limit: 10000,
},
},
],
},
resolve: {
alias: {
actions: path.resolve(__dirname, 'src/actions'),
components: path.resolve(__dirname, 'src/components'),
constants: path.resolve(__dirname, 'src/constants'),
containers: path.resolve(__dirname, 'src/containers'),
helpers: path.resolve(__dirname, 'src/helpers'),
reducers: path.resolve(__dirname, 'src/reducers'),
store: path.resolve(__dirname, 'src/store'),
styles: path.resolve(__dirname, 'src/styles'),
},
extensions: ['*', '.ts', '.tsx', '.js', '.jsx', '.json'],
},
output: {
path: path.resolve(__dirname, 'dist/'),
publicPath: '/dist/',
filename: 'bundle.js',
},
devServer: {
contentBase: path.join(__dirname, 'static/'),
port: 3001,
publicPath: '/dist/',
hotOnly: true,
},
plugins: [
new webpack.HotModuleReplacementPlugin({ multiStep: true }),
new webpack.DefinePlugin({
PRODUCTION: JSON.stringify(false),
env: {
DEVELOPMENT: JSON.stringify(false),
},
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
],
}