Skip to content

Commit e38231b

Browse files
authored
chore: fix build script output paths on windows (#20223)
closes #19169
1 parent 88b6f1c commit e38231b

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

packages/vuetify/build/rollup.config.mjs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ function fixWindowsPath(path) {
2727
return path.replace(/^[^:]+:\\/, '\\').replaceAll('\\', '/')
2828
}
2929

30+
const srcDir = fixWindowsPath(fileURLToPath(new URL('../src', import.meta.url)));
31+
const libDir = fixWindowsPath(fileURLToPath(new URL('../lib', import.meta.url)));
32+
const labsDir = fixWindowsPath(fileURLToPath(new URL('../src/labs', import.meta.url)));
33+
3034
export default [
3135
{
3236
input: 'src/entry-bundler.ts',
@@ -85,11 +89,9 @@ export default [
8589
})
8690

8791
// Individual CSS files
88-
for (const { id, content } of styleNodes) {
89-
const out = path.parse(fixWindowsPath(id).replace(
90-
fileURLToPath(new URL('../src', import.meta.url)),
91-
fileURLToPath(new URL('../lib', import.meta.url))
92-
))
92+
for (const {id, content} of styleNodes) {
93+
const relativePath = path.relative(srcDir, fixWindowsPath(id))
94+
const out = path.parse(path.join(libDir, relativePath))
9395
mkdirp(out.dir).then(() => {
9496
writeFile(path.join(out.dir, out.name + '.css'), content, 'utf8')
9597
})
@@ -222,12 +224,13 @@ export default [
222224
})
223225

224226
// Individual CSS files
225-
styleNodes = styleNodes.filter(node => node.id.includes('src/labs'))
227+
styleNodes = styleNodes.filter(node => {
228+
return fixWindowsPath(node.id).startsWith(labsDir)
229+
}
230+
);
226231
for (const { id, content } of styleNodes) {
227-
const out = path.parse(fixWindowsPath(id).replace(
228-
fileURLToPath(new URL('../src', import.meta.url)),
229-
fileURLToPath(new URL('../lib', import.meta.url))
230-
))
232+
const relativePath = path.relative(srcDir, fixWindowsPath(id))
233+
const out = path.parse(path.join(libDir, relativePath))
231234
mkdirp(out.dir).then(() => {
232235
writeFile(path.join(out.dir, out.name + '.css'), content, 'utf8')
233236
})

0 commit comments

Comments
 (0)