tsuintora's avatar

Laravel mix bootstrap & ckeditor

Hello guys, before you start to read this thread, i must say what my english so bad, but i hope you will understand all of this.

Thanks for your time!

I have this trouble: I don't want to use require('bootstrap') in app.js because laravel mix will build it again and again, so, i want to migrate bootstrap from app.js to vendor.js. To do this, i load boostrap in mix.autoload 'bootstrap':'bootstrap' but browser don't see bootstrap and with ckeditor (classeditor) this trouble repeating too.

How can i fix it?

mix.js('resources/js/app.js', 'public/js') .extract(['jquery', 'jquery-easing', 'bootstrap']) .sass('resources/sass/app.scss', 'public/css', { outputStyle: 'compressed' });

mix.autoload({ 'jquery': ['$', 'window.jQuery', 'jQuery'], 'bootstrap':'bootstrap' });

0 likes
8 replies
tsuintora's avatar
const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
    .extract(['jquery', 'jquery-easing', 'bootstrap/js/dist/collapse'])
    .sass('resources/sass/app.scss', 'public/css', {
        outputStyle: 'compressed'
    });

mix.autoload({
    'jquery': ['$', 'window.jQuery', 'jQuery']
});

Thanks for your attention, if i removing 'jquery' from .extract() then all works fine but jquery migrating in app.js , but it's not what i needed, is it real put in vendor.js jquery and bootstrap/js/dist/collapse? Because in example if i put jquery and bootstrap/js/dist/collapse then t(...).collapse is not a function

Yes, i load all of this

<script defer src = "{{ mix('/js/manifest.js') }}"></script>
<script defer src = "{{ mix('/js/vendor.js') }}"></script>
<script defer src = "{{ mix('/js/app.js') }}"></script>
tsuintora's avatar

Why i can't migrate bootstrap from app.js to vendor.js ;c

Please or to participate in this conversation.