Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bright-forks-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bob-the-bundler": patch
---

Use correct path for checking file existence in exports map.
4 changes: 2 additions & 2 deletions src/commands/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ async function checkExportsMapIntegrity(args: {
} else {
// package.json or other files
// for now we just make sure they exists
await fse.stat(cjsResult);
await fse.stat(path.join(args.cwd, cjsResult));
}

const esmResult = resolve.resolve({ exports: exportsMap }, key);
Expand Down Expand Up @@ -232,7 +232,7 @@ async function checkExportsMapIntegrity(args: {
} else {
// package.json or other files
// for now we just make sure they exists
await fse.stat(esmResult);
await fse.stat(path.join(args.cwd, esmResult));
}
}

Expand Down
6 changes: 4 additions & 2 deletions test/__fixtures__/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"default": "./dist/esm/*.js"
}
},
"./package.json": "./package.json"
"./package.json": "./package.json",
"./style.css": "./style.css"
},
"publishConfig": {
"directory": "dist",
Expand All @@ -45,7 +46,8 @@
"bob": {
"build": {
"copy": [
"foo.json"
"foo.json",
"src/style.css"
]
},
"check": {
Expand Down
3 changes: 3 additions & 0 deletions test/__fixtures__/simple/src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.foo {
color: red;
}
3 changes: 2 additions & 1 deletion test/integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ it("can bundle a simple project", async () => {
\\"default\\": \\"./esm/*.js\\"
}
},
\\"./package.json\\": \\"./package.json\\"
\\"./package.json\\": \\"./package.json\\",
\\"./style.css\\": \\"./style.css\\"
}
}"
`);
Expand Down