2015-10-17 34 views
5

我想在新項目中設置流量,但是我的webpack解析路徑令人困惑。我正在自動解析根文件夾,以便您可以使用components/Foo而不是../../../Components/Foo流量錯誤輸出中的Webpack路徑

有沒有辦法解決這個問題?我試着玩module.name_mapper= '^components/[a-zA-Z0-9$_]+$' -> 'src/components',但沒有奏效。

src/pages/Login.js:5 
    5: import View from 'components/View'; 
         ^^^^^^^^^^^^^^^^^ components/View. Required module not found 

回答