create-lve 0.4.8 → 0.4.10
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 +20 -1
- package/package.json +1 -1
- package/template-vue/tsconfig.node.json +4 -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,22 @@ 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
|
+
let content = await fs.readFile(tsconfigPath, 'utf-8')
|
|
131
|
+
|
|
132
|
+
if (content.includes('/* UNO_CONFIG */')) {
|
|
133
|
+
content = content.replace('/* UNO_CONFIG */', ', "uno.config.ts"')
|
|
134
|
+
await fs.writeFile(tsconfigPath, content)
|
|
135
|
+
}
|
|
136
|
+
} catch {}
|
|
137
|
+
}
|
|
138
|
+
|
|
120
139
|
const stylePath = path.join(ctx.targetDir, 'src/style.css')
|
|
121
140
|
if (fs.existsSync(stylePath)) await fs.remove(stylePath)
|
|
122
141
|
},
|
package/package.json
CHANGED