Skip to content

Commit e2e70e8

Browse files
authoredJun 16, 2023
feat: Update esbuild version to latest for keeping unknown directives during bundle (#925)
BREAKING CHANGE: update esbuild to 0.18
1 parent 322cb77 commit e2e70e8

File tree

5 files changed

+276
-7
lines changed

5 files changed

+276
-7
lines changed
 

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
*.log
33
dist
44
.cache
5-
playground
5+
playground
6+
.idea

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"cac": "^6.7.12",
3333
"chokidar": "^3.5.1",
3434
"debug": "^4.3.1",
35-
"esbuild": "^0.17.6",
35+
"esbuild": "^0.18.2",
3636
"execa": "^5.0.0",
3737
"globby": "^11.0.3",
3838
"joycon": "^3.0.1",

‎pnpm-lock.yaml

+265-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎test/__snapshots__/index.test.ts.snap

-2
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@ var foo_default = \\"foo\\";
212212
213213
// input.ts
214214
var input_default = foo_default;
215-
// Annotate the CommonJS export names for ESM import in node:
216-
0 && (module.exports = {});
217215
"
218216
`;
219217

‎test/index.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ test('simple', async () => {
9797
expect(outFiles).toEqual(['input.js'])
9898
})
9999

100+
test('should not filter unknown directives during bundle', async () => {
101+
const { output, outFiles } = await run(getTestName(), {
102+
'input.ts': `'use client'\nexport default 'foo'`,
103+
})
104+
expect(output).toContain('use client')
105+
expect(outFiles).toEqual(['input.js'])
106+
})
107+
100108
test('bundle graphql-tools with --dts flag', async () => {
101109
await run(
102110
getTestName(),

0 commit comments

Comments
 (0)
Please sign in to comment.