Please tell me how to use yarn.

Asked 2 years ago, Updated 2 years ago, 130 views

https://picturepan2.github.io/spectre/index.html#installation

I'd like to use this CSS framework called spectre.css, but I've rarely used yarn (also the original npm).

Running $yarn add spectre.css confirmed that the directory spectre.css was created in the directory node_modules and installed the file group.

I would like to create a static page called index.html with this CSS loaded, but I don't know how to load it.

node_modules/spectre.css/dist/ contains CSS, so

<linkrel="stylesheet" href="./node_modules/spectre.css/dist/spectre.css"> and I think I can load it. Is this correct?
When actually publishing a website, the path contains the letter node_modules which makes me uncomfortable.
Is that what it is?

For your information, the contents of node_modules/spectre.css/dist/

  • spectre-exp.css
  • spectre-exp.min.css
  • spectre-icons.css
  • spectre-icons.min.css
  • spectre.css
  • spectre.min.css

javascript node.js npm

2022-09-30 21:25

1 Answers

Nice to meet you.It may depend on the size of the application, but do you use module banders such as Webpack or Browserify for development? Otherwise, there is no problem if the path node_modules is included.

Third-party modules installed in npm, bower, etc. are typically called module banders such as Webpack, Browserify, and Rollup, which help resolve the dependency of loading external files in source code without worrying about the path to be loaded
If not, you can specify a relative path and read it.


2022-09-30 21:25

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.