yoggyd
yoggyd13mo ago

subpackage imports with npm specifiers

e.g. import colors from "npm:tailwindcss/colors" currently fails, is this not supposed to work? Solution: npm:tailwindcss/colors.js
4 Replies
ioB
ioB13mo ago
what happens if you use npm:@tailwind/colors instead?
marvinh.
marvinh.13mo ago
@yoggyd are you sure that you want tailwind and not tailwindcss? Only the latter is the popular CSS templating engine, whereas the former is something completely different
yoggyd
yoggyd13mo ago
sorry, I actually have tailwindcss in the code that's not working, I'll fix the original question @lino-levan that package does not exist. I'm not talking about a "full" package in another scope but a submodule from an existing package. The types can also be resolved, but colors.js is not being imported ah, adding .ts is not allowed, but .js is. Kinda makes sense, so the solution is import colors from "npm:tailwindcss/colors.js"
marvinh.
marvinh.13mo ago
yeah only .js works ther ebecause tehy don't ship ts in their package. See https://www.npmjs.com/package/tailwindcss?activeTab=code