Ask A Question

Notifications

You’re not receiving notifications from this thread.

How can i install Daisy UI?

Gabriel asked in Javascript

I want to be able to use Daisy UI, but i am reading different ways to accomplish this – making me confused on how to actually install node packages.

  1. One way is setting up the CDN, which is not the best way – its not even an option due to the file size for production. 2.Another way is using npm i -D daisyui and then adding to tailwind.config.js:

...
plugins: [require("daisyui")],
}

but i have a feeling npm is being discouraged as I keep reading of people saying "with importmaps you no longer have to use npm"

  1. Using importmaps? Which i don’t really know how to use it. Would this be the same as using the CDN, but adding it to the importmaps file? But somehow installing it with importmaps doesn't seem to make the package work as it says its not found in tailwind config file

  2. Final question: How can i tell when is better to just install packages using npm or to include them in the importmaps file?

Reply

I think for larger projects with multiple dependencies, using npm with a build process (such as webpack or Parcel) can provide better control, optimization, and management of dependencies.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,796+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.