Reputation: 2406
I'm on a Symfony 4 new project.
Via yarn, I installed (by example) the CSS library animate.css
yarn install animate.css
From the webpack.config.js file, I added the animate.css file like that :
.addStyleEntry('animate', './node_modules/animate.css/animate.css')
My question is : is it a good way to add a CSS library like that ? I'm not sure if use directly the node_module path is a good practice..
Is there a better way ?
Upvotes: 0
Views: 312
Reputation: 511
Normally you inject it directly in the .js file you are using
ex:
require('animate.css/animate.css')
or something in this way depending on your js superset if you have one so it will generate a .css file with your .js
an example is this:
on my first line of my typescript file I call this import ./style.css
after that Encore will generate me a nwe .css file that i can use in my template using {{ encore_entry_link_tags('entry') }}
Upvotes: 1