create-lve 0.6.3 → 0.6.5
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 +4 -5
- package/index.js +1 -1
- package/package.json +1 -1
- package/template-react/src/main.tsx +0 -1
- package/template-react/vite.config.ts +5 -5
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
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
await fs.
|
|
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
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineConfig, loadEnv, lazyPlugins } from 'vite-plus'
|
|
1
|
+
import { defineConfig, loadEnv, lazyPlugins, type Plugin } from 'vite-plus'
|
|
3
2
|
import react, { reactCompilerPreset } from '@vitejs/plugin-react'
|
|
4
3
|
|
|
5
4
|
const mode = process.env.NODE_ENV || 'development'
|
|
@@ -13,7 +12,7 @@ export default defineConfig({
|
|
|
13
12
|
'*': 'vp check --fix',
|
|
14
13
|
},
|
|
15
14
|
plugins: [
|
|
16
|
-
|
|
15
|
+
/* VITE_PLUS_PLUGINS */
|
|
17
16
|
react(),
|
|
18
17
|
// lazyPlugins 返回类型与 Vite plugins 字段类型不兼容
|
|
19
18
|
// 上游 issue: vitejs/vite#22085,官方确认为已知问题
|
|
@@ -25,7 +24,7 @@ export default defineConfig({
|
|
|
25
24
|
presets: [reactCompilerPreset()],
|
|
26
25
|
}),
|
|
27
26
|
]
|
|
28
|
-
}) as
|
|
27
|
+
}) as Plugin[],
|
|
29
28
|
],
|
|
30
29
|
resolve: {
|
|
31
30
|
tsconfigPaths: true,
|
|
@@ -35,8 +34,9 @@ export default defineConfig({
|
|
|
35
34
|
output: {
|
|
36
35
|
manualChunks(id) {
|
|
37
36
|
if (!id.includes('node_modules')) return
|
|
38
|
-
if (id.includes('react') && !id.includes('react-router')) return 'vendor-react'
|
|
39
37
|
if (id.includes('react-dom')) return 'vendor-react-dom'
|
|
38
|
+
if (id.includes('react') && !id.includes('react-router') && !id.includes('react-dom'))
|
|
39
|
+
return 'vendor-react'
|
|
40
40
|
if (id.includes('react-router')) return 'vendor-router'
|
|
41
41
|
if (id.includes('@tanstack')) return 'vendor-query'
|
|
42
42
|
if (id.includes('radix-ui')) return 'vendor-radix'
|