Skip to content

Commit

Permalink
fix: set absWorkingDir for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Feb 12, 2024
1 parent 8c581c0 commit 695bc9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
yarn build examples/node-hybrid
yarn build examples/node-next
yarn build examples/wildcard
git status
git diff --exit-code
lint:
runs-on: ubuntu-latest
Expand Down
9 changes: 5 additions & 4 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ function display(prefix: string) {
const displayError = display(kleur.red('error:'))
const displayWarning = display(kleur.yellow('warning:'))

function bundle(options: BuildOptions) {
function bundle(options: BuildOptions, base: string) {
// show entry list
for (const [key, value] of Object.entries(options.entryPoints!)) {
const source = relative(process.cwd(), value)
const target = relative(process.cwd(), resolve(options.outdir!, key + options.outExtension!['.js']))
const source = relative(base, value)
const target = relative(base, resolve(options.outdir!, key + options.outExtension!['.js']))
console.log('esbuild:', source, '->', target)
}

Expand Down Expand Up @@ -212,6 +212,7 @@ async function dumble(cwd: string, manifest: PackageJson, tsconfig: TsConfig, op
}

matrix.push({
absWorkingDir: cwd,
outdir,
outbase,
target: tsconfig.compilerOptions?.target as any,
Expand Down Expand Up @@ -287,7 +288,7 @@ async function dumble(cwd: string, manifest: PackageJson, tsconfig: TsConfig, op

await Promise.all(matrix.map(async (options) => {
try {
await bundle(options)
await bundle(options, process.cwd())
} catch (error) {
console.error(error)
}
Expand Down

0 comments on commit 695bc9f

Please sign in to comment.