-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
38 lines (35 loc) · 835 Bytes
/
webpack.dev.js
File metadata and controls
38 lines (35 loc) · 835 Bytes
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
const path = require('path');
const { merge } = require('webpack-merge');
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'development',
devServer: {
contentBase: path.join(__dirname, 'dist'),
port: 9000,
hot: true,
},
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.less$/,
use: [
'css-hot-loader',
MiniCssExtractPlugin.loader,
'css-loader',
'less-loader',
],
exclude: /node_modules/,
},
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new MiniCssExtractPlugin({ filename: '[name].css' }),
],
output: {
filename: '[name].js',
},
});