hans meyer
hans meyer

Reputation: 101

How to use downloaded yarn dependencies

this is probably a really stupid question, but it'd be awesome if you could help me. Here's the problem: I've added a package to my project. It contains some css files which I want to use in my HTML files and so on. I've added it by using yarn add <package>. The files are located inside /node_modules/semantic-ui-css/semantic.min.css.

Do I have to reference complete node_module path to load the css file inside my HTML file? That just doesn't sound right. Before I used a package manager I just downloaded a few css files, placed them into /vendor/css/ and used them.

Or is it normal these days to use <link rel="stylesheet" type="text/css" href="node_modules/semantic-ui-css/semantic.min.css">?

Upvotes: 3

Views: 2044

Answers (1)

ccprog
ccprog

Reputation: 21821

Target folders can be defined with

yarn install --modules-folder vendor/ semantic-ui-css

giving you a results of

href="vendor/semantic-ui-css/semantic.min.css"

Each package will always be wrapped in its own folder.

Upvotes: 3

Related Questions