Skip to content

Commit 07ed951

Browse files
authored
fix: ensure CSS output filename matches package.json exports (#520)
- Use assetInfo.names instead of deprecated assetInfo.name - Ensure CSS files are output as style.css to match ./style.css export - Fix incorrect CSS filename (was index.css, now style.css) - Bump version to 1.1.2
1 parent fe691e8 commit 07ed951

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "json-tree-view-vue3",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "JSON tree rendering Vue3 component",
55
"repository": {
66
"type": "git",

vite.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ export default defineConfig({
3434
vue: 'Vue'
3535
},
3636
assetFileNames: (assetInfo) => {
37-
if (assetInfo.name === 'style.css') return 'style.css'
38-
return assetInfo.name ?? 'asset'
37+
// Ensure CSS is output as style.css to match package.json exports
38+
const fileName = assetInfo.names?.[0]
39+
if (fileName && /\.css$/.test(fileName)) {
40+
return 'style.css'
41+
}
42+
return fileName ?? 'assets/[name]-[hash][extname]'
3943
}
4044
}
4145
}

0 commit comments

Comments
 (0)