引用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 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏