windicss/docs

Plugin installation procedure not clear & wrong package name in example configuration

Closed this issue · 4 comments

I havent used TailwindCSS before except from trying it using the CDN so I can't tell how to install plugins for WindiCSS which in the docs it naturally assumes previous tailwind knowledge.

I followed the configuration from this page and made this one:

module.exports = {
	darkMode: 'class',
	extract: {
		include: [
			'public/index.html',
			'public/static/views/*.html',
			'public/static/js/**/*.{js}',
		],
	},
	theme: {},
	variants: {},
	plugins: [
		require('windicss/plugin/forms'),
		require('windicss/plugin/typography'),
	],
};

I looked for instructions on which npm packages to install so just installed linked ones:

npm install @tailwindcss/typography
npm install @tailwindcss/forms

yet I still get this when trying to compile using the official CLI tool:

Error: Cannot find module 'windicss/plugin/forms'
...

i changed windicss/plugin/ to @tailwindcss/ naturally since it's the name of the packages despite being doubtful because the configuration from the docs specified otherwise, and it worked!

Is the package names automatically converted by Vite or other tools or there's actually a windicss/plugin/forms that i can't find or install?

the official plugins are shipped with windicss by default, I guess

@alexanderniebuhr weird, i wonder why the CLI would say they're not found. perhaps i should just adopt a build tool / bundler, Vite looks nice
Thanks anyway!

Ahh cli would not work I guess :(
Since it does not have node_modules.. maybe if you install it globally with npm i -g windicss

That's how I installed it, I guess using it on its own have its drawbacks since you have to do all the work yourself (file watcher etc). I figured it's not worth the effort unless for it's small scripts or part of a build tool, for a project it's better to use a tool that does all the work like Vite.
I just tried that and I'll be using it. I was hesitant since I only started learning JS a couple months ago and not yet familiar with the ecosystem.

Thanks for these great tools! ^^