bootstarp4ではTetherを使っており、以下のようなエラーが出る。
Uncaught Error: Bootstrap tooltips require Tether
Tetherをnpmでインストール
$ npm install tether -S
webpack.mix.jsを修正
以下を追加する。
webpack.mix.js
/**
* Add tether for bootstrap4
*/
mix.autoload({
tether: ['Tether', 'window.Tether']
});
結果、webpack.mix.jsはこんな感じに
webpack.mix.js
const { mix } = require('laravel-mix');
/**
* Add tether for bootstrap4
*/
mix.autoload({
tether: ['Tether', 'window.Tether']
});
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.react('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.version();
GitHubのissueではjqueryも読み込ませてますが、とりあえずこれがなくてもコンソールエラーは起きませんでした。もしかしたら必要なのかもしれません・・・
https://github.com/JeffreyWay/laravel-mix/issues/584#issuecomment-287445207