-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
91 lines (88 loc) · 2.15 KB
/
Copy pathwebpack.config.dev.js
File metadata and controls
91 lines (88 loc) · 2.15 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
83
84
85
86
87
88
89
90
91
//
// jonathanballands.me
// webpack.config.dev.js
//
// © 2018 Jonathan Ballands
//
const webpack = require('webpack');
const path = require('path');
// -----------------------------------------------------------------------------
module.exports = {
mode: 'development',
context: path.resolve(__dirname),
entry: ['webpack/hot/dev-server', './src/index.jsx'],
optimization: {
minimize: false,
},
output: {
path: path.resolve(__dirname, './public'),
publicPath: '/',
filename: 'bundle.js',
chunkFilename: '[chunkhash].bundle.js',
},
module: {
rules: [
{
test: /\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
use: [
{ loader: 'url-loader?limit=8192' },
{ loader: 'img-loader' },
],
},
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
use: [
{
loader: 'babel-loader',
},
],
},
{
test: /\.md$/,
use: [
{
loader: 'raw-loader',
},
],
},
],
},
plugins: [new webpack.HotModuleReplacementPlugin()],
resolve: {
extensions: ['.js', '.jsx', '.md'],
alias: {
actions: path.resolve(__dirname, './src/actions'),
components: path.resolve(__dirname, './src/components'),
containers: path.resolve(__dirname, './src/containers'),
experiments: path.resolve(__dirname, './experiments'),
helpers: path.resolve(__dirname, './src/helpers'),
kinesis: path.resolve(__dirname, './src/kinesis'),
posts: path.resolve(__dirname, './posts'),
reducers: path.resolve(__dirname, './src/reducers'),
routes: path.resolve(__dirname, './src/routes'),
sagas: path.resolve(__dirname, './src/sagas'),
src: path.resolve(__dirname, './src'),
svg: path.resolve(__dirname, './src/svg'),
styles: path.resolve(__dirname, './src/styles'),
'~': path.resolve(__dirname, '.'),
},
},
devServer: {
contentBase: [
path.resolve(__dirname, './public'),
path.resolve(__dirname, './public/markdown'),
path.resolve(__dirname, './public/assets'),
],
historyApiFallback: true,
watchContentBase: true,
host: '0.0.0.0',
port: 3001,
hot: true,
},
devtool: 'source-map',
};