Skip to content

Commit

Permalink
Fix Rollup semicolon bug in GSS import (#5)
Browse files Browse the repository at this point in the history
The `await` and `import` statements were moved onto the same line in
lib/deps.js. This resolves a bug in the Rollup module bundler, which was
incorrectly adding a semicolon after the `await` keyword.
  • Loading branch information
AlexGodbehere authored Apr 19, 2024
2 parents 651ab45 + b3df1c2 commit c0a1938
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
package-lock.json
/.idea
7 changes: 5 additions & 2 deletions lib/deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
*/

/* No GSS on Windows. */
export const GSS = await
import("gssapi.js")
/* `await` and `import` must be on the same line to circumvent
* a bug in Rollup where it insists on adding a semicolon after
* the `await` keyword.
*/
export const GSS = await import("gssapi.js")
.then(mod => mod.default)
.catch(e => undefined);

Expand Down

0 comments on commit c0a1938

Please sign in to comment.