2017-09-21 52 views
0

我試圖整合Materialise的,但是當我嘗試添加角Materialise的字體

"./node_modules/materialize-css/dist/js/materialize.js" 

"./node_modules/materialize-css/sass/materialize.scss", 

到webpack.config.json

我得到這個錯誤建立(我得到多個):

ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader?{"ident":"postcss"}!./~/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./~/materialize-css/sass/materialize.scss 
Module not found: Error: Can't resolve '../fonts/roboto/Roboto-Thin.woff2' in 'C:\Users\Administrateur\Documents\dev\git\front-ptc-angular\node_modules\materialize-css\sass' 
@ ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader?{"ident":"postcss"}!./~/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./~/materialize-css/sass/materialize.scss 6:77358-77402 
@ ./~/materialize-css/sass/materialize.scss 
@ multi ./~/materialize-css/sass/materialize.scss ./src/assets/scss/main.scss 

有什麼想法?

編輯:

我通過NPM

然後加入兩行,我的WebPack配置

+0

您是否試過https://www.npmjs.com/package/angular2-materialize並通過底部的安裝指南運行? –

+0

我通過NPM瞭解到,這不是我用物化做的第一個項目,但我從來沒有遇到過這樣的問題:/ –

回答

0

我用兌現亭子,它給了加angular2,兌現和兌現,CSS我同樣的問題,我通過將文件夾/ fonts/roboto複製到物化的css和js文件夾的級別來解決它。