fix(tools): always use posix for path resolving (#9627)
This commit is contained in:
@@ -45,7 +45,7 @@ const gitShortHash = once(() => {
|
|||||||
if (GITHUB_SHA) {
|
if (GITHUB_SHA) {
|
||||||
return GITHUB_SHA.substring(0, 9);
|
return GITHUB_SHA.substring(0, 9);
|
||||||
}
|
}
|
||||||
const repo = new Repository(ProjectRoot.path);
|
const repo = new Repository(ProjectRoot.value);
|
||||||
const shortSha = repo.head().target()?.substring(0, 9);
|
const shortSha = repo.head().target()?.substring(0, 9);
|
||||||
if (shortSha) {
|
if (shortSha) {
|
||||||
return shortSha;
|
return shortSha;
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ export function createWebpackConfig(
|
|||||||
pkg.join('tailwind.config.js').exists()
|
pkg.join('tailwind.config.js').exists()
|
||||||
? [
|
? [
|
||||||
require('tailwindcss')(
|
require('tailwindcss')(
|
||||||
require(pkg.join('tailwind.config.js').path)
|
require(pkg.join('tailwind.config.js').value)
|
||||||
),
|
),
|
||||||
'autoprefixer',
|
'autoprefixer',
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import { existsSync, statSync } from 'node:fs';
|
import { existsSync, statSync } from 'node:fs';
|
||||||
import { join, relative } from 'node:path';
|
import { join, relative } from 'node:path/posix';
|
||||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||||
|
|
||||||
export class Path {
|
export class Path {
|
||||||
|
private readonly path: string;
|
||||||
|
|
||||||
static dir(url: string) {
|
static dir(url: string) {
|
||||||
return new Path(join(fileURLToPath(url), '..'));
|
return new Path(fileURLToPath(url)).join('..');
|
||||||
}
|
}
|
||||||
|
|
||||||
get value() {
|
get value() {
|
||||||
@@ -15,7 +17,9 @@ export class Path {
|
|||||||
return './' + this.path.slice(ProjectRoot.path.length).replace(/\\/g, '/');
|
return './' + this.path.slice(ProjectRoot.path.length).replace(/\\/g, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(public readonly path: string) {}
|
constructor(path: string) {
|
||||||
|
this.path = path.replaceAll('\\', '/');
|
||||||
|
}
|
||||||
|
|
||||||
join(...paths: string[]) {
|
join(...paths: string[]) {
|
||||||
return new Path(join(this.path, ...paths));
|
return new Path(join(this.path, ...paths));
|
||||||
|
|||||||
Reference in New Issue
Block a user