gargi369's avatar

Bootstraping semantic-ui

I would include my semantic-ui js when bootstraping application before vue but after jquery. How can I do it?

{{-- Vue --}}
<script>
    window.Laravel = document.getElementById("csrf-token").getAttribute("content");
</script>
<script src="js/app.js"></script>

{{-- Vendor --}}
<script src="vendor/jquery/js/jquery.min.js"></script>
<script src="vendor/semantic/semantic.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>

{{-- Application scripts --}}
<script src="js/initialize.js"></script>
<script src="js/modal.js"></script>

I cant use semantic-ui method like dimmer or modal in this structure. So I choose include as require in bootstrap.js but I dont know how to do it... And iI should remove /vendor/jquery adn vendor/semantic include in blade.

Someone did it ?

0 likes
4 replies
starbolt's avatar
starbolt
Best Answer
Level 6

You should install semantic ui using NPM:

npm install semantic-ui --save

Then on your app.js file you could import it before the bootstrap.js file.

gargi369's avatar

oh, I did it and it's working at this moment. Thank you :)

import '../../../semantic/dist/semantic';

require('./bootstrap');

Is it the only solution? Can I do it better or it is good enough? I'm back end developer so I'm not familiar with JS workflow enough.

mitsuzero's avatar

i use cdn's semanticUI (in my layout.blade.php) and get working very well....

massuncao's avatar

Hi guys.

I am new at this. I have an application made with laravel, using bootstrap. I realy like the looks of Semantics UI, but i cannot find any information on how to include semantics in laravel.

Can you guys tell me how to use semantics on a fresh installation of laravel, i want to rebuild the whole views, i am just keeping the controllers and models,

Please or to participate in this conversation.