-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
35 lines (32 loc) · 895 Bytes
/
webpack.dev.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
const webpack = require('webpack');
const merge = require('webpack-merge');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const baseConfig = require('./webpack.config.js');
const host = 'localhost';
module.exports = merge(baseConfig, {
mode: 'development',
devtool: 'inline-source-map',
entry: {
bundle: [
'@babel/polyfill',
'react-hot-loader/patch',
`webpack-dev-server/client?http://${host}:3000`,
'webpack/hot/only-dev-server',
path.resolve(__dirname, 'src/index.js'),
],
},
output: {
path: path.resolve(__dirname, 'public'),
publicPath: '/',
filename: '[name].[hash:16].js',
chunkFilename: '[id].[hash:16].js',
},
plugins: [
new webpack.HotModuleReplacementPlugin(), // HMR을 사용하기 위한 플러그인
new HtmlWebpackPlugin({
filename: 'index.html',
title: 'React Design Editor',
}),
],
});