webpack 遇到报错情况及解决

  • webpack2 报错:optimize.OccurenceOrderPlugin is not a function。
    原因:上个版本拼写错误,少写了一个字母r,新版本修正过来了。要写成这样:OccurrenceOrderPlugin。

  • 报错:This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
    解决:

{
  resolve: {
    alias: {
      'react': 'my/react/path'
    }
  },
  module: {
    noParse: [/react/]
  }
}

posted on 2017-08-22 14:31  cag2050  阅读(324)  评论(0编辑  收藏  举报

导航