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

Mz/make bundleable #1026

Merged
merged 2 commits into from
Feb 22, 2024
Merged

Mz/make bundleable #1026

merged 2 commits into from
Feb 22, 2024

Conversation

mingxuanzhangsfdx
Copy link
Member

What does this PR do?

make the code bundle-able without affecting the existing workflow.

What issues does this PR fix or reference?

@W-15022712@
https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00001jzB1UYAU/view

@@ -4,6 +4,7 @@
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"esModuleInterop": true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'esModuleInterop' makes typescript compiler treat commonjs similar to ES6 modules.

I made the changes in all tsconfig.json. This way we abandon usage like import * as Faye from 'faye'; which esbuild does not support for commonjs module. Even if there is no change of code here in examples/test, it is still good to use it.

@@ -11,7 +11,7 @@ import Transport from 'jsforce/lib/transport';
import { AsyncCreatable, Duration, parseJsonMap, sleep } from '@salesforce/kit';
import { HttpRequest, OAuth2Config } from 'jsforce';
import { ensureString, isString, JsonMap, Nullable } from '@salesforce/ts-types';
import * as FormData from 'form-data';
import FormData from 'form-data';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes like this are to make the import statement compatible with esbuild without hurting the existing compiling process of typescript compiler.

@mshanemc mshanemc merged commit 9d5a5dd into main Feb 22, 2024
68 checks passed
@mshanemc mshanemc deleted the mz/make-bundleable branch February 22, 2024 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants