3
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

LaravelにFont Awesome5を導入する

Last updated at Posted at 2019-09-15

決まったコマンドと貼り付けるファイルがあるので、メモをしておきます。

ターミナル
$ npm install @fortawesome/fontawesome-free

と打ちます。

上記のコマンドの結果、package.jsonに

package.json
"@fortawesome/fontawesome-free": "^5.10.2", (バージョンはそれぞれ)

と追加されているのを確認したら、

下記のコマンドでパスを指定し

_variables.scss
$fa-font-path: "../webfonts";

scssファイルをインポートします。

app.scss
@import "~@fortawesome/fontawesome-free/scss/fontawesome.scss";
@import "~@fortawesome/fontawesome-free/scss/regular.scss";
@import "~@fortawesome/fontawesome-free/scss/solid.scss";
@import "~@fortawesome/fontawesome-free/scss/brands.scss";

以上で完成です!

ターミナル
$ npm run watch

あとは監視!

3
5
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?