Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Use an IIFE where possible #88

Merged
merged 2 commits into from
Oct 8, 2024
Merged

build: Use an IIFE where possible #88

merged 2 commits into from
Oct 8, 2024

Conversation

NotNite
Copy link
Member

@NotNite NotNite commented Oct 8, 2024

We weren't wrapping things in an IIFE so global scope was being ruined by various dependencies (e.g. window was full of minified variable names lol). This PR fixes this by wrapping everything in an IIFE and telling esbuild to assign it to global variable module.exports to fix the exports. This results in this very funny build output:

"use strict";
var module;
(module ||= {}).exports = (() => {
  // ...
})();

Should be ready to merge, I just want to test this heavily as it could break everything. This will also need to be brought over to the sample extension build script.

@NotNite NotNite self-assigned this Oct 8, 2024
@NotNite NotNite marked this pull request as ready for review October 8, 2024 14:10
@NotNite
Copy link
Member Author

NotNite commented Oct 8, 2024

Tested and it seems to be OK. If shit breaks it's my fault. :p

@NotNite NotNite merged commit 8ebc44b into develop Oct 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant