Wanted to use bootstrap 4 so I swapped bootstrap-sass for bootstrap 4.0.0-alpha6. bootstrap 4 uses tether library. tether should be added to the global scope before bootstrap is added. This works fine until you want to use the extract() method to vendor the libraries.
This returns Uncaught Error: Bootstrap tooltips require Tether
package.json dependency: Swap "bootstrap-sass": "^3.3.7", with "bootstrap": "^4.0.0-alpha.6",resources/assets/js/bootstrap.js change require('bootstrap-sass) with require('bootstrap)window.Tether = require('tether'); right before require('bootstrap')resources/assets/sass/app.scss to point to bootstrap instead of boostrap-sass.extract(['tether', 'bootstrap']) to webpack.mix.js@moleculezz, maybe this one could help https://github.com/JeffreyWay/laravel-mix/issues/440#issuecomment-286465595
mix.autoload({
jquery: ['$', 'jQuery', 'window.jQuery'],
tether: ['Tether', 'window.Tether']
});
Or you can just separate your build into 2 chunks (e.g. bootstrap.js and app.js) and don't bother with extract. It's not like CommonsChunkPlugin was specifically designed to extract vendor libraries. There are easier ways to achieve the same considering your build complexity.
Thanks. mix.autoload worked fine.
It's strange though. It seems as if the bootstrap.js file does the same thing as mix.autoload.
Most helpful comment