我在webpack.config.js中设置了入口点和输出,但是出现了一些错误:
i 「wds」: Project is running at http://localhost:9000/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from D:\Projects\react-redux-registration-login-example\public
i 「wds」: 404s will fallback to /index.html
i 「wdm」: Hash: cb37c515d6a1771b5bcb
webpack.config.js ,并且配置文件中的每个文件和文件夹都存在
// Webpack uses this to work with directories
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
// This is main configuration object.
// Here you write different options and tell Webpack what to do
module.exports = {
// Path to your entry point. From this file Webpack will begin his work
entry: "./src/index.js",// Path and filename of your result bundle.
// Webpack will bundle all JavaScript into this file
output: {
path: path.resolve(__dirname,"build"),filename: "bundle.js",publicPath: '/'
},module: {
rules: [
{
loader: "babel-loader",test: /\.js$|jsx/,exclude: /node_modules/
},{ test: /\.html$/i,loader: 'html-loader' },]
},// Default mode for Webpack is production.
// Depending on mode Webpack will apply different things
// on final bundle. For now we don't need production's JavaScript
// minifying and other thing so let's set mode to development
mode: "development",devserver: {
contentBase: path.join(__dirname,"public"),inline: true,compress: true,port: 9000,historyApiFallback: true
},plugins: [
new HtmlWebpackPlugin({
template: './public/index.html',fileName: path.join('.','build','index.html')
})
]
};
我尝试搜索一些解决方案,但仍然无法正常工作。请帮助我找出配置中的错误。