create-lve 0.4.8 → 0.4.9
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 +22 -1
- package/package.json +1 -1
package/config.js
CHANGED
|
@@ -74,7 +74,12 @@ const CSS_STRATEGIES = {
|
|
|
74
74
|
entryImport: "import '@unocss/reset/tailwind.css'\nimport 'virtual:uno.css'\n",
|
|
75
75
|
async setup(ctx) {
|
|
76
76
|
const unoConfig = `
|
|
77
|
-
import {
|
|
77
|
+
import {
|
|
78
|
+
defineConfig,
|
|
79
|
+
presetWind3,
|
|
80
|
+
transformerCompileClass,
|
|
81
|
+
type SourceCodeTransformer,
|
|
82
|
+
} from 'unocss'
|
|
78
83
|
import { createHash } from 'node:crypto'
|
|
79
84
|
|
|
80
85
|
declare const process: { env: { NODE_ENV: string } }
|
|
@@ -115,8 +120,24 @@ export default defineConfig({
|
|
|
115
120
|
]
|
|
116
121
|
: []) as SourceCodeTransformer[],
|
|
117
122
|
})
|
|
123
|
+
|
|
118
124
|
`.trim()
|
|
119
125
|
await fs.writeFile(path.join(ctx.targetDir, 'uno.config.ts'), unoConfig + '\n')
|
|
126
|
+
|
|
127
|
+
const tsconfigPath = path.join(ctx.targetDir, 'tsconfig.node.json')
|
|
128
|
+
if (fs.existsSync(tsconfigPath)) {
|
|
129
|
+
try {
|
|
130
|
+
const tsconfig = await fs.readJson(tsconfigPath)
|
|
131
|
+
if (!tsconfig.include) {
|
|
132
|
+
tsconfig.include = []
|
|
133
|
+
}
|
|
134
|
+
if (Array.isArray(tsconfig.include) && !tsconfig.include.includes('uno.config.ts')) {
|
|
135
|
+
tsconfig.include.push('uno.config.ts')
|
|
136
|
+
await fs.writeJson(tsconfigPath, tsconfig, { spaces: 2 })
|
|
137
|
+
}
|
|
138
|
+
} catch {}
|
|
139
|
+
}
|
|
140
|
+
|
|
120
141
|
const stylePath = path.join(ctx.targetDir, 'src/style.css')
|
|
121
142
|
if (fs.existsSync(stylePath)) await fs.remove(stylePath)
|
|
122
143
|
},
|