diff --git a/playgrounds/default/package.json b/playgrounds/default/package.json index c37492c9..e5207f96 100644 --- a/playgrounds/default/package.json +++ b/playgrounds/default/package.json @@ -4,9 +4,9 @@ "private": true, "type": "module", "scripts": { - "dev": "bun ../../src/cli.ts", - "build": "NODE_ENV=production bun ../../src/cli.ts build", - "preview": "bun ../../src/cli.ts preview", + "dev": "bun ../../src/cli/index.ts", + "build": "NODE_ENV=production bun ../../src/cli/index.ts build", + "preview": "bun ../../src/cli/index.ts preview", "dist:dev": "vocs", "dist:build": "NODE_ENV=production vocs build", "dist:preview": "vocs preview" diff --git a/playgrounds/tailwind/package.json b/playgrounds/tailwind/package.json index 8a047f24..d3c69726 100644 --- a/playgrounds/tailwind/package.json +++ b/playgrounds/tailwind/package.json @@ -4,9 +4,9 @@ "private": true, "type": "module", "scripts": { - "dev": "bun ../../src/cli.ts", - "build": "NODE_ENV=production bun ../../src/cli.ts build", - "preview": "bun ../../src/cli.ts preview" + "dev": "bun ../../src/cli/index.ts", + "build": "NODE_ENV=production bun ../../src/cli/index.ts build", + "preview": "bun ../../src/cli/index.ts preview" }, "dependencies": { "react": "^18.2.0", diff --git a/src/package.json b/src/package.json index 44e45627..bba71ce9 100644 --- a/src/package.json +++ b/src/package.json @@ -12,13 +12,7 @@ }, "peerDependencies": { "react": "^18.2.0", - "react-dom": "^18.2.0", - "tailwindcss": "^3.3.3" - }, - "peerDependenciesMeta": { - "tailwindcss": { - "optional": true - } + "react-dom": "^18.2.0" }, "dependencies": { "@jmoxey/rehype-pretty-code": "^0.10.2-1", @@ -52,6 +46,7 @@ "serve-static": "^1.15.0", "shiki": "^0.14.5", "shiki-processor": "^0.1.3", + "tailwindcss": "^3.3.3", "ua-parser-js": "^1.0.36", "unist-util-visit": "^5.0.0", "vite": "4.4.11" diff --git a/src/vite/plugins/css.ts b/src/vite/plugins/css.ts index dabc697c..bb402f33 100644 --- a/src/vite/plugins/css.ts +++ b/src/vite/plugins/css.ts @@ -2,6 +2,8 @@ import { accessSync } from 'node:fs' import { resolve } from 'node:path' import { default as autoprefixer } from 'autoprefixer' import { default as tailwindcss } from 'tailwindcss' +// @ts-expect-error +import { default as tailwindcssNesting } from 'tailwindcss/nesting' import type { PluginOption } from 'vite' import { postcssRawStyles } from './postcss/rawStyles.js' @@ -17,6 +19,7 @@ export function css(): PluginOption { plugins: [ postcssRawStyles(), autoprefixer(), + tailwindcssNesting(), tailwindConfig ? (tailwindcss as any)({ config: tailwindConfig,