when referencing popper.js, if packaging does not rule out popper.js, calling new PopperJS, an error will be reported
let PopperJS = require("./popper");
let popper = new PopperJS(); // PopperJS is not a constructor
webpack.base.conf.js:
{
test: /\.js(x)*$/,
loader: "babel-loader",
include: [resolve("src")]
},
webpack.base.conf.js, it is normal if popper.js is excluded.
{
test: /\.js(x)*$/,
loader: "babel-loader",
include: [resolve("src")],
exclude: [resolve("src/utils/popper.js")]
},
excuse me, why is this happening?