Package Exports
- esbuild-plugin-tailwindcss
- esbuild-plugin-tailwindcss/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (esbuild-plugin-tailwindcss) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
esbuild-plugin-tailwindcss
Just a module to simplify the connection of TailwindCSS
Install
yarn add -D esbuild-plugin-tailwindcssor
npm i -D esbuild-plugin-tailwindcssUsage
Add plugin in build config:
import { tailwindPlugin } from 'esbuild-plugin-tailwindcss';
esbuild.build({
plugins: [
tailwindPlugin({
// configPath: 'path/to/tailwind.config.js',
}),
],
});Create file tailwind.config.js at the root of the project:
export default {
content: ['./source/**/*.{js,jsx,ts,tsx}'],
// ...
// The rest of the tailwindcss configuration
// For more, see: https://tailwindcss.com/docs/configuration
};Create file index.css:
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';Import index.css from index.{js,jsx,ts,tsx} file:
import './index.css';Done, you can use the TailwindCSS in the project!