create-lve 0.6.2 → 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
@@ -276,16 +276,17 @@ async function applyProjectTransform(ctx) {
276
276
  }
277
277
 
278
278
  let viteContent = await fs.readFile(paths.vite, 'utf-8')
279
- viteContent = strategy.pluginImport + viteContent
279
+ if (!viteContent.includes(strategy.pluginImport.trim())) {
280
+ viteContent = strategy.pluginImport + viteContent
281
+ }
280
282
  viteContent = viteContent.replace('/* VITE_PLUS_PLUGINS */', strategy.pluginCode)
281
283
  await fs.writeFile(paths.vite, viteContent)
282
284
 
283
285
  let mainContent = await fs.readFile(paths.main, 'utf-8')
284
- await fs.writeFile(paths.main, strategy.entryImport + mainContent)
285
-
286
- const stylePath = path.join(targetDir, 'src/style.css')
287
- await fs.ensureDir(path.dirname(stylePath))
288
- 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)
289
290
 
290
291
  await strategy.setup(ctx)
291
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.2",
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,官方确认为已知问题