无法在网页包中设置未定义的属性“index”。我在听一个视频讲座,发现了这个错误,我在谷歌上没有得到任何帮助。
在webpc/dist/index.js中
chunks.forEach((chunk, i) => {
const extractedChunk = extractedChunks[i];
extractedChunk.index = i;
extractedChunk.originalChunk = chunk;
extractedChunk.name = chunk.name;
在自定义文件webpack.config.js中
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require("path");
module.exports = {
entry: "./config.js",
output: {
filename: "app.js",
path: path.resolve(__dirname, "public/javascripts"),
},
};
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [
{
loader: "css-loader",
options: {
minimize: true,
},
},
],
}),
},
],
},
plugins: [new ExtractTextPlugin("../stylesheets/app.css")],
};
[1]: https://i.stack.imgur.com/LV9m1.png
[2]: https://i.stack.imgur.com/aiMj0.png
[3]: https://i.stack.imgur.com/vjRih.png
暂无答案!
目前还没有任何答案,快来回答吧!