引用popper.js时,如果打包不排除popper.js,调用new PopperJS 就会报错
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,配置了排除popper.js就正常了
{
test: /\.js(x)*$/,
loader: 'babel-loader',
include: [resolve('src')],
exclude: [resolve('src/utils/popper.js')]
},
请问为什么会这样?
请问有哪位知道原因吗