引用popper.js webpack不配置exclude: '/popper.js'调用PopperJSj就会报错

引用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')]
      },

请问为什么会这样?

阅读 5.3k
2 个回答
推荐问题
宣传栏