当我尝试运行开发模式时,我在标题中收到警告。该脚本过去在早期网站上运行良好,但现在我总是收到此警告。
这是我的 package.json:
{
"name": "frontend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "webpack --mode development --watch",
"build": "webpack --mode production"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.13.10",
"@babel/preset-env": "^7.13.12",
"@babel/preset-react": "^7.12.13",
"babel-loader": "^8.2.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"webpack": "^5.27.2",
"webpack-cli": "^4.5.0"
},
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.11.2",
"react-router-dom": "^5.2.0"
}
}
Run Code Online (Sandbox Code Playgroud)
还有我的 webpack.config.js:
const path = require("path");
const webpack = require("webpack");
module.exports = {
entry: "./src/index.js",
output: {
path: path.resolve(__dirname, …Run Code Online (Sandbox Code Playgroud)