0
我想通過酏劑和吞嚥將材料設計http://fezvrasta.github.io/bootstrap-material-design/bootstrap-elements.html帶入Laravel。Laravel吞噬&酏劑材料設計
我做:
npm install bootstrap-material-design
這成功我看到node_modules
地圖。然後我說這個我app.scss
@import "/node_modules/bootstrap-material-design/scss/bootstrap-material-design";
而且我一飲而盡文件看起來像這樣:
elixir(function(mix) {
mix.sass('app.scss');
mix.browserify('app.js');
});
當我嘗試在我的終端一飲而盡它說:
[17:16:31] Finished 'default' after 743 ms
[17:16:31] gulp-notify: [Laravel Elixir] Sass Compilation Failed: resources/assets/sass/app.scss
Error: File to import not found or unreadable: /node_modules/bootstrap-material-design/scss/bootstrap-material-design
Parent style sheet: stdin
on line 2 of stdin
>> @import "/node_modules/bootstrap-material-design/scss/bootstrap-material-desig
^
{ [Error: resources/assets/sass/app.scss
Error: File to import not found or unreadable: /node_modules/bootstrap-material-design/scss/bootstrap-material-design
Parent style sheet: stdin
on line 2 of stdin
>> @import "/node_modules/bootstrap-material-design/scss/bootstrap-material-desig
^
]
我在做什麼錯誤?
以'/'開頭的路徑是相對於根的絕對路徑。在你的情況下,它會是你的計算機的根目錄,它(可能)沒有node_modules目錄。刪除路徑上的前導斜槓使其相對。然後您需要根據您的目錄結構放置正確的相對路徑。例如,如果你告訴我們你把app.scss和你的node_modules文件夾放在哪裏,那麼有人可以幫助使用相對路徑 –
@benswinburne我使用Laravel把它放在recources/sass/app.scss中 – Jamie
如果我記得正確的gulp在與您的gulpfile.js文件所在的目錄相同,因此您應該能夠從路徑的起始位置刪除正斜槓(/),並且它將起作用'@import'node_modules/bootstrap-material-design/scss/bootstrap 「材料設計」;' –