Skip to content

Commit fd452ce

Browse files
committed
fix: 🐛 sanitize drupal library name
1 parent 56b45f2 commit fd452ce

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

packages/vite-plugin-drupal/build.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default defineBuildConfig({
77
'src/ce/ApiCustomElements',
88
'src/bootstrap',
99
],
10+
externals: ['web-component-analyzer', 'vite', 'typescript'],
1011
clean: true,
1112
declaration: true,
1213
rollup: {

packages/vite-plugin-drupal/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,22 @@
5757
"postcss": "^8.4.38",
5858
"postcss-import": "^16.1.0",
5959
"tailwindcss": "^3.4.3",
60-
"typescript": "^5.4.5",
6160
"unimport": "^3.7.1",
6261
"unplugin-icons": "^0.19.0",
63-
"unplugin-vue-components": "^0.26.0",
64-
"vite": "^5.0.11",
65-
"vue": "^3.4.5",
66-
"vue-tsc": "^1.8.27"
62+
"unplugin-vue-components": "^0.27.0",
63+
"vite": "^5.2.11",
64+
"vue": "^3.4.26",
65+
"vue-tsc": "^2.0.16"
6766
},
6867
"devDependencies": {
69-
"@types/node": "^20.10.6",
70-
"defu": "^6.1.3",
68+
"@types/fs-extra": "^11.0.4",
69+
"@types/node": "^20.12.8",
70+
"defu": "^6.1.4",
7171
"fast-glob": "^3.3.2",
7272
"fs-extra": "^11.2.0",
73-
"magic-string": "^0.30.5",
74-
"rollup": "^4.9.3",
73+
"magic-string": "^0.30.10",
74+
"rollup": "^4.17.2",
7575
"web-component-analyzer": "^2.0.0",
76-
"yaml": "^2.3.4"
76+
"yaml": "^2.4.2"
7777
}
7878
}

packages/vite-plugin-drupal/src/plugins/libraries.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ function getLibID(file: string, ctx: Context) {
267267
const match = file.match(/^(css|js)\//)
268268
if (match)
269269
name = match[0] + name
270+
name = name.replace(/\//g, '__')
270271
return name
271272
}
272273

packages/vite-plugin-drupal/src/plugins/theme.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export default (ctx: Context): Plugin => {
1616
'core_version_requirement': '^9 || ^10',
1717
'hidden': true,
1818
'libraries': [
19-
`${ctx.distThemeName}/css/tailwind`,
20-
`${ctx.distThemeName}/js/main`,
21-
`${ctx.distThemeName}/css/gin-custom`,
19+
`${ctx.distThemeName}/css__tailwind`,
20+
`${ctx.distThemeName}/js__main`,
21+
`${ctx.distThemeName}/css__gin-custom`,
2222
],
2323

2424
}

0 commit comments

Comments
 (0)