npm uninstall --save-dev bootstrap-sass
接著安裝Bootstrap4以及popper.js
npm install bootstrap@4.4.1 popper.js --save-dev
修改resources/assets/js/bootstrap.js
try {
window.$ = window.jQuery = require('jquery');
window.Popper = require('popper.js').default;
require('bootstrap');
} catch (e) {}
修改
@import "~bootstrap/scss/bootstrap.scss"
編譯完就成功啦
npm run dev
參考資料:
https://medium.com/@sasthakl/upgrading-laravel-5-5-to-bootstrap-4-fe11714fbdaa