-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.js
38 lines (31 loc) · 1.05 KB
/
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
36
37
38
"use strict";
const path = require("path");
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = merge(common, {
mode: 'development',
// The JavaScript file to be injected into the HTML file
entry: path.resolve(__dirname, "index.dev.js"),
devtool: 'inline-source-map',
// This plugin updates React components without losing their state
plugins: [
new ReactRefreshWebpackPlugin(),
// This plugin allows us to use a HTML file template.
// In the settings we specify its title and 'entry'
// specifies a script to be injected into the template
new HtmlWebpackPlugin({
title: "PureScript Starter",
template: path.resolve(__dirname, "src", "index.html"),
})
],
devServer: {
contentBase: path.join(__dirname, 'dist'),
historyApiFallback: true,
compress: true,
port: 9000,
hotOnly: true,
hot: true,
},
});