Fixed hot reload

This commit is contained in:
Jake Ginnivan 2022-05-09 20:42:39 +08:00
parent a2ceaa46a4
commit 9c6000a2c9
2 changed files with 8 additions and 2 deletions

View File

@ -3,7 +3,7 @@
"scripts": {
"zip": "node createZip.js",
"prebuild": "npm run zip",
"dev": "cross-env NODE_ENV=development webpack-dev-server",
"dev": "cross-env NODE_ENV=development webpack serve --open",
"prod": "npm run zip && cross-env NODE_ENV=production webpack"
},
"devDependencies": {

View File

@ -1,6 +1,7 @@
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const path = require("path");
module.exports = {
entry: "./src/css/tailwind.src.css",
@ -13,6 +14,11 @@ module.exports = {
},
],
},
devServer: {
static: "./dist",
watchFiles: path.join(__dirname, "src"),
hot: true,
},
plugins: [
new MiniCssExtractPlugin(),
new HtmlWebpackPlugin({