安裝 Adminlte
$ cnpm install admin-lte --save
編輯 /resources/js/bootstrap.js
window.Popper = require('popper.js').default;
window.$ = window.jQuery = require('jquery');
require('bootstrap');
require('admin-lte');
編輯 /resources/scss/app.scss
@import "~bootstrap/scss/bootstrap";
@import "~admin-lte/dist/css/adminlte.css";
$fa-font-path: "../webfonts";
@import "~@fortawesome/fontawesome-free/scss/fontawesome.scss";
@import "~@fortawesome/fontawesome-free/scss/solid.scss";
@import "~@fortawesome/fontawesome-free/scss/brands.scss";
編輯 /webpack.mix.js
const mix = require('laravel-mix');
mix.js('resources/js/app.js', 'public/js')
.sass('resources/scss/app.scss', 'public/css')
編譯前端資源
$ npm run prod
在專案中使用
<link rel="stylesheet" type="text/css" href="{{ mix('css/app.css') }}">
<script src="{{ mix('js/app.js') }}"></script>
本作品採用《CC 協議》,轉載必須註明作者和本文連結