mosh-hamedani / react-testing-starter

58 stars 126 forks source link

ReferenceError: require is not defined for "tailwind.config.ts" #5

Open srinivas-nahak opened 1 month ago

srinivas-nahak commented 1 month ago

The project is failing to build due to this error.

srinivas-nahak commented 1 month ago

`import { Config } from "tailwindcss"; // Import the plugin using ES Modules import typography from "@tailwindcss/typography";

// Tailwind configuration const config: Config = { content: ["./index.html", "./src/*/.{js,ts,jsx,tsx}"], theme: { extend: {}, }, plugins: [ typography, // Use the imported typography plugin ], };

export default config;`

This code helped me to fix the error.

nguillermin commented 1 week ago

I am getting the same error. This worked for me.

import typography from '@tailwindcss/typography'

/** @type {import('tailwindcss').Config} */
export default {
  content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
  theme: {
    extend: {},
  },
  plugins: [
      typography
  ],
};