diff --git a/.changeset/wicked-hairs-rescue.md b/.changeset/wicked-hairs-rescue.md new file mode 100644 index 000000000..6b4da6b39 --- /dev/null +++ b/.changeset/wicked-hairs-rescue.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Add `mdx` extension to default generated Tailwind config. diff --git a/examples/with-tailwindcss/tailwind.config.cjs b/examples/with-tailwindcss/tailwind.config.cjs index dc0ae5c8f..49971da79 100644 --- a/examples/with-tailwindcss/tailwind.config.cjs +++ b/examples/with-tailwindcss/tailwind.config.cjs @@ -1,5 +1,5 @@ module.exports = { - content: ['./src/**/*.{astro,html,js,jsx,md,svelte,ts,tsx,vue}'], + content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'], theme: { extend: {}, }, diff --git a/packages/astro/e2e/fixtures/tailwindcss/tailwind.config.js b/packages/astro/e2e/fixtures/tailwindcss/tailwind.config.js index 7aeb483c1..a7a741ba3 100644 --- a/packages/astro/e2e/fixtures/tailwindcss/tailwind.config.js +++ b/packages/astro/e2e/fixtures/tailwindcss/tailwind.config.js @@ -1,7 +1,7 @@ const path = require('path'); module.exports = { - content: [path.join(__dirname, 'src/**/*.{astro,html,js,jsx,md,svelte,ts,tsx,vue}')], + content: [path.join(__dirname, 'src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}')], theme: { extend: { colors: { diff --git a/packages/astro/src/core/add/index.ts b/packages/astro/src/core/add/index.ts index 4062e59e5..d6ee73791 100644 --- a/packages/astro/src/core/add/index.ts +++ b/packages/astro/src/core/add/index.ts @@ -41,7 +41,7 @@ const ALIASES = new Map([ const ASTRO_CONFIG_STUB = `import { defineConfig } from 'astro/config';\n\nexport default defineConfig({});`; const TAILWIND_CONFIG_STUB = `/** @type {import('tailwindcss').Config} */ module.exports = { - content: ['./src/**/*.{astro,html,js,jsx,md,svelte,ts,tsx,vue}'], + content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'], theme: { extend: {}, }, diff --git a/packages/astro/test/fixtures/tailwindcss/tailwind.config.js b/packages/astro/test/fixtures/tailwindcss/tailwind.config.js index 7aeb483c1..a7a741ba3 100644 --- a/packages/astro/test/fixtures/tailwindcss/tailwind.config.js +++ b/packages/astro/test/fixtures/tailwindcss/tailwind.config.js @@ -1,7 +1,7 @@ const path = require('path'); module.exports = { - content: [path.join(__dirname, 'src/**/*.{astro,html,js,jsx,md,svelte,ts,tsx,vue}')], + content: [path.join(__dirname, 'src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}')], theme: { extend: { colors: {