Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b1c1d14

Browse files
committed
docs: update reproduction
1 parent cfa5b17 commit b1c1d14

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

apps/www/.vitepress/theme/utils/codeeditor.ts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { getParameters } from 'codesandbox/lib/api/define'
55
import cssRaw from '../../../../../packages/cli/test/fixtures/frameworks/nuxt/assets/css/tailwind.css?raw'
66
import { Index as demoIndex } from '../../../../www/__registry__'
77
// @ts-expect-error ?raw
8-
import tailwindConfigRaw from '../../../tailwind.config?raw'
98

109
export function makeCodeSandboxParams(componentName: string, style: RegistryStyle, sources: Record<string, string>) {
1110
let files: Record<string, any> = {}
@@ -39,17 +38,11 @@ const viteConfig = {
3938
content: `import path from "path"
4039
import { defineConfig } from 'vite'
4140
import vue from '@vitejs/plugin-vue'
41+
import tailwindcss from '@tailwindcss/vite'
4242
43-
import tailwind from 'tailwindcss';
44-
import autoprefixer from 'autoprefixer';
4543
4644
export default defineConfig({
47-
css: {
48-
postcss: {
49-
plugins: [tailwind(), autoprefixer()],
50-
},
51-
},
52-
plugins: [vue()],
45+
plugins: [vue(), tailwindcss()],
5346
resolve: {
5447
alias: {
5548
"@": path.resolve(__dirname, "./src"),
@@ -79,16 +72,22 @@ export default defineConfig({
7972

8073
function constructFiles(componentName: string, style: RegistryStyle, sources: Record<string, string>) {
8174
const componentsJson = {
82-
style,
75+
$schema: 'https://shadcn-vue.com/schema.json',
76+
style: 'new-york',
77+
typescript: true,
8378
tailwind: {
84-
config: 'tailwind.config.js',
79+
config: '',
8580
css: 'src/assets/index.css',
8681
baseColor: 'zinc',
8782
cssVariables: true,
83+
prefix: '',
8884
},
8985
aliases: {
90-
utils: '@/utils',
9186
components: '@/components',
87+
composables: '@/composables',
88+
utils: '@/lib/utils',
89+
ui: '@/components/ui',
90+
lib: '@/lib',
9291
},
9392
iconLibrary: 'lucide',
9493
}
@@ -114,7 +113,8 @@ function constructFiles(componentName: string, style: RegistryStyle, sources: Re
114113
'vite': 'latest',
115114
'@vitejs/plugin-vue': 'latest',
116115
'vue-tsc': 'latest',
117-
'tailwindcss': 'v3.4.13',
116+
'tailwindcss': 'latest',
117+
'@tailwindcss/vite': 'latest',
118118
'autoprefixer': 'latest',
119119
}
120120

@@ -153,10 +153,6 @@ function constructFiles(componentName: string, style: RegistryStyle, sources: Re
153153
isBinary: false,
154154
},
155155
...viteConfig,
156-
'tailwind.config.js': {
157-
content: tailwindConfigRaw,
158-
isBinary: false,
159-
},
160156
'tsconfig.json': {
161157
content: `{
162158
"$schema": "https://json.schemastore.org/tsconfig",

0 commit comments

Comments
 (0)