0
私はマテリアルデザインhttp://fezvrasta.github.io/bootstrap-material-design/bootstrap-elements.htmlをエラクサーとガルプと一緒にLaravelに入れようとしています。Laravel gulp&elixirマテリアルデザイン
私がやった:私はnode_modules
でマップを参照してください
npm install bootstrap-material-design
成功したこと。それから私は私の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
あなたのgulpfile.jsファイルと同じディレクトリなので、パスの先頭からスラッシュ(/)を取り除くだけで、 '@import 'を動作させることができます。node_modules/bootstrap-material-design/scss/bootstrap -material-design "; ' –