Skip to content

Commit

Permalink
chore: fix build script output paths on windows (#20223)
Browse files Browse the repository at this point in the history
closes #19169
  • Loading branch information
stephane303 authored Jul 26, 2024
1 parent 88b6f1c commit e38231b
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/vuetify/build/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ function fixWindowsPath(path) {
return path.replace(/^[^:]+:\\/, '\\').replaceAll('\\', '/')
}

const srcDir = fixWindowsPath(fileURLToPath(new URL('../src', import.meta.url)));
const libDir = fixWindowsPath(fileURLToPath(new URL('../lib', import.meta.url)));
const labsDir = fixWindowsPath(fileURLToPath(new URL('../src/labs', import.meta.url)));

export default [
{
input: 'src/entry-bundler.ts',
Expand Down Expand Up @@ -85,11 +89,9 @@ export default [
})

// Individual CSS files
for (const { id, content } of styleNodes) {
const out = path.parse(fixWindowsPath(id).replace(
fileURLToPath(new URL('../src', import.meta.url)),
fileURLToPath(new URL('../lib', import.meta.url))
))
for (const {id, content} of styleNodes) {
const relativePath = path.relative(srcDir, fixWindowsPath(id))
const out = path.parse(path.join(libDir, relativePath))
mkdirp(out.dir).then(() => {
writeFile(path.join(out.dir, out.name + '.css'), content, 'utf8')
})
Expand Down Expand Up @@ -222,12 +224,13 @@ export default [
})

// Individual CSS files
styleNodes = styleNodes.filter(node => node.id.includes('src/labs'))
styleNodes = styleNodes.filter(node => {
return fixWindowsPath(node.id).startsWith(labsDir)
}
);
for (const { id, content } of styleNodes) {
const out = path.parse(fixWindowsPath(id).replace(
fileURLToPath(new URL('../src', import.meta.url)),
fileURLToPath(new URL('../lib', import.meta.url))
))
const relativePath = path.relative(srcDir, fixWindowsPath(id))
const out = path.parse(path.join(libDir, relativePath))
mkdirp(out.dir).then(() => {
writeFile(path.join(out.dir, out.name + '.css'), content, 'utf8')
})
Expand Down

0 comments on commit e38231b

Please sign in to comment.