Webpack 不会更新我的包,并且在使用npm run build.
我的目录:
----MyProject
--------------src
----------index.js
--------- ---------index.html
--------webpack.config.js
--------package.json
我尝试重新安装 webpack,它帮助了一次,但是无论我重新安装多少次都不会再次更新。
webpack.config.js
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
entry: path.join(__dirname, "src", "index.js"),
output: {
path: path.join(__dirname, "build"),
filename: "bundle.js",
publicPath: "/"
},
devServer: {
historyApiFallback:true
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.(css|scss)$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"postcss-loader",
"sass-loader"
]
},
{
test: /\.(jpg|jpeg|png|gif|mp3|svg)$/,
use: …Run Code Online (Sandbox Code Playgroud)