Skip to content

Commit a1fced1

Browse files
craig-rieckeacao
andauthored
fix vscode-graphql-execution esbuild.js (#3480)
* Update esbuild.js A possibly naive way to make vscode extension work after esbuild upgrade. * Update esbuild.js Turns out I was quite naive about just excluding graphql-config. The extension worked under the Test Runner, but not when bundled and installed. This change actually does work, even when the plugin is bundled and installed separately. It uses the technique outlined in evanw/esbuild#2441 * add changeset --------- Co-authored-by: Rikki Schulte <[email protected]>
1 parent a808019 commit a1fced1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.changeset/smooth-clocks-try.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"vscode-graphql-execution": patch
3+
"vscode-graphql": patch
4+
---
5+
6+
Fix execution extension esbuild bundling

packages/vscode-graphql-execution/esbuild.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ build({
4949
],
5050
format: 'cjs',
5151
sourcemap: true,
52+
define: { 'import.meta.url': '_importMetaUrl' },
53+
banner: {
54+
js: "const _importMetaUrl=require('url').pathToFileURL(__filename)",
55+
},
5256
})
5357
.then(({ errors, warnings }) => {
5458
if (warnings.length) {

0 commit comments

Comments
 (0)