create-lve 0.4.7 → 0.4.8
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 +8 -5
- package/package.json +1 -1
- package/template-vue/vite.config.ts +1 -1
package/config.js
CHANGED
|
@@ -70,14 +70,14 @@ const FRAMEWORK_CONFIG = {
|
|
|
70
70
|
const CSS_STRATEGIES = {
|
|
71
71
|
unocss: {
|
|
72
72
|
pluginImport: "import UnoCSS from 'unocss/vite'\n",
|
|
73
|
-
pluginCode: 'UnoCSS(
|
|
73
|
+
pluginCode: 'UnoCSS(), ',
|
|
74
74
|
entryImport: "import '@unocss/reset/tailwind.css'\nimport 'virtual:uno.css'\n",
|
|
75
75
|
async setup(ctx) {
|
|
76
76
|
const unoConfig = `
|
|
77
77
|
import { defineConfig, presetWind3, transformerCompileClass, SourceCodeTransformer } from 'unocss'
|
|
78
|
+
import { createHash } from 'node:crypto'
|
|
78
79
|
|
|
79
80
|
declare const process: { env: { NODE_ENV: string } }
|
|
80
|
-
|
|
81
81
|
const isBuild = process.env.NODE_ENV === 'production'
|
|
82
82
|
|
|
83
83
|
export default defineConfig({
|
|
@@ -105,13 +105,16 @@ export default defineConfig({
|
|
|
105
105
|
},
|
|
106
106
|
transformerCompileClass({
|
|
107
107
|
classPrefix: '',
|
|
108
|
-
hashFn: (str) =>
|
|
109
|
-
|
|
108
|
+
hashFn: (str) => {
|
|
109
|
+
// return createHash('md5').update(str).digest('hex').slice(0, 8)
|
|
110
|
+
const hash = createHash('md5').update(str).digest('hex').slice(0, 8)
|
|
111
|
+
return /^\\d/.test(hash) ? 'v' + hash.slice(1, 8) : hash.slice(0, 8)
|
|
112
|
+
},
|
|
113
|
+
keepUnknown: true,
|
|
110
114
|
}),
|
|
111
115
|
]
|
|
112
116
|
: []) as SourceCodeTransformer[],
|
|
113
117
|
})
|
|
114
|
-
|
|
115
118
|
`.trim()
|
|
116
119
|
await fs.writeFile(path.join(ctx.targetDir, 'uno.config.ts'), unoConfig + '\n')
|
|
117
120
|
const stylePath = path.join(ctx.targetDir, 'src/style.css')
|
package/package.json
CHANGED