After installing bulma through NPM, how can I refer it in my project

26,253

That is really unevident. If you want to get bulma work with fontawesome5 via npm, minimum working deps (for now) are:

npm i -S bulma @fortawesome/fontawesome @fortawesome/fontawesome-free-solid

then needed to be initialized like this:

import fontawesome from '@fortawesome/fontawesome'
import solid from '@fortawesome/fontawesome-free-solid'
import 'bulma/css/bulma.css'

fontawesome.library.add(solid)

More details can be found here: https://fontawesome.com/how-to-use/use-with-node-js

Share:
26,253
TheBAST
Author by

TheBAST

Updated on August 07, 2020

Comments

  • TheBAST
    TheBAST over 3 years

    I have pulled in bulma in my project through :

    $ npm install bulma
    

    After that, how can I refer to it in my pages. I really don't know how to work with npm, so please can you guide me. Do I have to refer to it in my js by saying: import bulma from 'bulma' or require it, I don't know where my files are. That means I don't know where are they located.

  • Drumbeg
    Drumbeg about 6 years
    If the OP has installed already using npm. He probably does not want to pull in Bulma using CDN.
  • Omkar
    Omkar over 5 years
    do not suggest beginners to use ../../ relative paths. Using webpack, you can use aliases
  • dnhyde
    dnhyde over 5 years
    Do you mean using @/../node_modules/... I can edit my answer if this is what you suggest
  • Omkar
    Omkar over 5 years
    No, look at relative paths vs aliases. Node js automatically picks up node modules, so you dont have to provide a complete path. Either ways, even if its not from node modules, its recommended to use aliases provided by module bundlers to reduce the nesting of paths. The practice of nesting will end up adding lot of unreadable paths when the app will grow large.