2016-03-17 27 views
0

如果我在構建Webpack包時不斷從忽略路徑的文件中獲取Babel-specilific錯誤,那麼我做錯了什麼?babel-loader編譯排除路徑中的文件

我的錯誤永遠是這樣:

Module build failed: 
ReferenceError: [BABEL] 
/Users/benjamin/Code/Bounce/bounce-new/node_modules/section-iterator/dist/sectionIterator.js: 
Using removed Babel 5 option: 
/Users/benjamin/Code/Bounce/bounce-new/node_modules/section-iterator/.babelrc.stage 
- Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets 

注意node_module目錄。看起來Babel試圖用該模塊的.babelrc配置從外部模塊編譯代碼。這絕對不是我所期望的,因爲我從node_modules路徑忽略巴貝爾加載文件:

請告訴我,這裏是我的錯誤。

回答

2

嘗試做排除:/ node_modules的/,而不是排除: '/ node_modules /',

+0

大,謝謝!我完全忘記了在這裏使用適當的正則表達式。 – vtambourine