-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
43 lines (36 loc) · 1.06 KB
/
webpack.dev.js
File metadata and controls
43 lines (36 loc) · 1.06 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
const path = require('path');
const chalk = require('chalk');
const webpack = require('webpack');
const merge = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ip = require('ip');
const common = require('./webpack.common.js');
console.log('local ip address', chalk.yellow(chalk.bold(ip.address())));
module.exports = merge(common, {
devtool: 'cheap-module-eval-source-map',
mode: 'development',
devServer: {
host: ip.address(),
port: 9000,
hot: true,
https: true,
contentBase: path.join(__dirname, 'dist'),
historyApiFallback: true,
},
output: {
publicPath: "/",
},
plugins: [
new webpack.DefinePlugin({
// SERVER: "'http://0.0.0.0:4000'",
NODE_ENV: "'development'",
}),
new webpack.HotModuleReplacementPlugin({}),
// This plugin will cause the relative path of the module to be displayed when HMR is enabled.
new webpack.NamedModulesPlugin(),
new HtmlWebpackPlugin({
template: './index.dev.ejs',
title: 'Dev-Fourth Person',
}),
],
});