Skip to content

Commit

Permalink
fix(tailwind): use mjs template (#2945)
Browse files Browse the repository at this point in the history
  • Loading branch information
ineshbose authored Dec 21, 2024
1 parent c0455c8 commit 8cf9f27
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/tailwind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,26 @@ export default function installTailwind(

// 2. add config template
const configTemplate = addTemplate({
filename: 'nuxtui-tailwind.config.cjs',
filename: 'nuxtui-tailwind.config.mjs',
write: true,
getContents: ({ nuxt }) => `
const { defaultExtractor: createDefaultExtractor } = require('tailwindcss/lib/lib/defaultExtractor.js')
const { customSafelistExtractor, generateSafelist } = require(${JSON.stringify(resolve(runtimeDir, 'utils', 'colors'))})
import { defaultExtractor as createDefaultExtractor } from "tailwindcss/lib/lib/defaultExtractor.js";
import { customSafelistExtractor, generateSafelist } from ${JSON.stringify(resolve(runtimeDir, 'utils', 'colors'))};
import formsPlugin from "@tailwindcss/forms";
import aspectRatio from "@tailwindcss/aspect-ratio";
import typography from "@tailwindcss/typography";
import containerQueries from "@tailwindcss/container-queries";
import headlessUi from "@headlessui/tailwindcss";
const defaultExtractor = createDefaultExtractor({ tailwindConfig: { separator: ':' } })
const defaultExtractor = createDefaultExtractor({ tailwindConfig: { separator: ':' } });
module.exports = {
export default {
plugins: [
require('@tailwindcss/forms')({ strategy: 'class' }),
require('@tailwindcss/aspect-ratio'),
require('@tailwindcss/typography'),
require('@tailwindcss/container-queries'),
require('@headlessui/tailwindcss')
formsPlugin({ strategy: 'class' }),
aspectRatio,
typography,
containerQueries,
headlessUi
],
content: {
files: [
Expand Down

0 comments on commit 8cf9f27

Please sign in to comment.