-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.ts
45 lines (43 loc) · 1.1 KB
/
webpack.dev.ts
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
import path from 'path';
import webpack from 'webpack';
import { merge } from 'webpack-merge';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import InterpolateHtmlPlugin from 'react-dev-utils/InterpolateHtmlPlugin';
import commonConfig from './webpack.common';
const devConfig: webpack.Configuration = {
mode: 'development',
output: {
assetModuleFilename: '[name][ext]',
},
module: {
rules: [
{
test: /\.less$/i,
use: ['style-loader', 'css-loader', 'less-loader'],
},
{
test: /\.s(a|c)ss$/i,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
new InterpolateHtmlPlugin(HtmlWebpackPlugin, {
PUBLIC_URL: '',
}),
],
devtool: 'inline-source-map',
devServer: {
contentBase: path.resolve('public'),
compress: true,
port: 3000,
open: true,
hot: true,
host: '0.0.0.0',
useLocalIp: true,
},
};
export default merge(commonConfig, devConfig);