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 f73f282
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 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
2 changes: 1 addition & 1 deletion examples/cross-platform/lib/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ __export(src_exports, {
foo: () => foo
});
module.exports = __toCommonJS(src_exports);
var import_adapter = require("@dunble-examples/cross-platform/adapter");
var import_adapter = require("@dumble-examples/cross-platform/adapter");
function foo() {
return console.log((0, import_adapter.platform)());
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cross-platform/lib/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });

// src/index.ts
import { platform } from "@dunble-examples/cross-platform/adapter";
import { platform } from "@dumble-examples/cross-platform/adapter";
function foo() {
return console.log(platform());
}
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 f73f282

Please sign in to comment.