Aframe with webpack - systems[name] 不是构造函数

Pla*_*256 5 webpack aframe

在尝试与 webpack 一起使用时,我遇到了此错误。

我的 webpack 配置是:

const path = require("path");
const webpack = require('webpack');
const HtmlWebpackPlugin = require("html-webpack-plugin");

const nodeFallbacks = require("./nodeFallbacks");

const { WebpackManifestPlugin } = require("webpack-manifest-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");

const cwd = process.cwd();
const outputPath = path.join(cwd, "build");

module.exports = {
  mode: "development",
  devtool: "cheap-module-source-map",
  context: path.resolve(cwd, "./"),
  entry: {
    main: "./src/index.js"
  },
  output: {
    path: outputPath,
    publicPath: "/",
    pathinfo: false,
  },
  resolve: {
    extensions: [".ts", ".tsx", ".js", ".json", ".mjs"],
    fallback: {
      ...nodeFallbacks,
    },
  },
  module: {
    rules: [
      {
        test: /\.(js|jsx|ts|tsx)?$/,
        exclude: [/node_modules/],
        use: [
          {
            loader: "babel-loader?cacheDirectory",
          },
        ],
      },
      {
        test: /\.css$/,
        use: ["style-loader", "css-loader"],
      },
      {
        test: /\.html$/i,
        loader: "html-loader",
      },
    ],
  },
  plugins: [
    new WebpackManifestPlugin(),
    new HtmlWebpackPlugin({
      template: path.resolve(cwd, "./src/index.html"),
      inject: 'head'
    }),
    new CopyWebpackPlugin({
      patterns: [{ from: "src/assets", to: "assets" }],
    }),

    new webpack.ProvidePlugin({
      AFRAME: 'aframe',
    })
  ],
};
Run Code Online (Sandbox Code Playgroud)

我已经从 npm 注册表安装了 aframe 并在 index.js 上导入