create-lve 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/config.js CHANGED
@@ -283,11 +283,10 @@ async function applyProjectTransform(ctx) {
283
283
  await fs.writeFile(paths.vite, viteContent)
284
284
 
285
285
  let mainContent = await fs.readFile(paths.main, 'utf-8')
286
- await fs.writeFile(paths.main, strategy.entryImport + mainContent)
287
-
288
- const stylePath = path.join(targetDir, 'src/style.css')
289
- await fs.ensureDir(path.dirname(stylePath))
290
- await fs.writeFile(stylePath, `@import 'tailwindcss';\n\n${BASE_STYLE}\n`)
286
+ if (!mainContent.includes(strategy.entryImport.trim())) {
287
+ mainContent = strategy.entryImport + mainContent
288
+ }
289
+ await fs.writeFile(paths.main, mainContent)
291
290
 
292
291
  await strategy.setup(ctx)
293
292
  }
package/index.js CHANGED
@@ -90,7 +90,7 @@ async function main() {
90
90
 
91
91
  cssEngine: ({ results }) =>
92
92
  results.framework === 'next'
93
- ? p.note('Next.js 已内置 Tailwind,无需选择')
93
+ ? (p.note('Next.js 已内置 Tailwind,无需选择'), 'tailwind')
94
94
  : p.select({
95
95
  message: '选择 CSS',
96
96
  options: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lve",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "bin": {
5
5
  "create-lve": "index.js"
6
6
  },
@@ -1,4 +1,3 @@
1
- import './style.css'
2
1
  import { StrictMode } from 'react'
3
2
  import { createRoot } from 'react-dom/client'
4
3
  import { Providers } from './app/providers'
@@ -1,4 +1,3 @@
1
- import tailwindcss from '@tailwindcss/vite'
2
1
  import { defineConfig, loadEnv, lazyPlugins } from 'vite-plus'
3
2
  import react, { reactCompilerPreset } from '@vitejs/plugin-react'
4
3
 
@@ -13,7 +12,7 @@ export default defineConfig({
13
12
  '*': 'vp check --fix',
14
13
  },
15
14
  plugins: [
16
- tailwindcss(),
15
+ /* VITE_PLUS_PLUGINS */
17
16
  react(),
18
17
  // lazyPlugins 返回类型与 Vite plugins 字段类型不兼容
19
18
  // 上游 issue: vitejs/vite#22085,官方确认为已知问题