Typer无法设置未定义的提取文本网页包插件\dist\index.js:211:32的属性“index”

bvjxkvbb  于 2021-09-13  发布在  Java
关注(0)|答案(0)|浏览(193)

无法在网页包中设置未定义的属性“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

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题