Jake
Jake

Reputation: 185

Add Bootstrap4 via npm to a Symfony4 project

I am pretty new to Symfony and NPM, Composer etc. I set up my symfony project and installed Bootstrap 4 via NPM

npm install bootstrap

Now the bootstrap files are located in the "node_modules/bootstrap" folder. How can I include this sources correctly in my base.html.twig?

<link href="{{ asset('node_modules/bootstrap/dist/css/bootstrap.min.css') }}" rel="stylesheet">

I don't know if that is the correct way. As I said, I am new to this.

Upvotes: 1

Views: 376

Answers (1)

Mert Cengiz
Mert Cengiz

Reputation: 11

You can use "import" in your js file to import css.

import 'bootstrap/dist/css/bootstrap.min.css';

https://reactstrap.github.io/

Upvotes: 1

Related Questions