fix: Add ESM build and TypeScript compatibility for verbatimModuleSyntax#3
Open
saseungmin wants to merge 1 commit intoTapjoy:mainfrom
Open
fix: Add ESM build and TypeScript compatibility for verbatimModuleSyntax#3saseungmin wants to merge 1 commit intoTapjoy:mainfrom
saseungmin wants to merge 1 commit intoTapjoy:mainfrom
Conversation
…bility - Add ESM build configuration (tsconfig.build.json) - Generate lib/module/ with ES modules instead of exposing src/ - Update package.json to point to compiled output - Fix type-only imports in src files - Remove unnecessary CommonJS build This fixes TypeScript errors when verbatimModuleSyntax is enabled. Users were getting TS1484 errors because: 1. react-native field pointed to source files (src/index) 2. Source files used regular imports for types 3. lib/module/ directory was missing despite being declared
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Users with
verbatimModuleSyntax: truein their TypeScript config get errors:Root causes:
package.jsonreact-nativefield points to source files (src/index)lib/module/directory doesn't existimport typesyntaxSolution
lib/module/outputChanges
tsconfig.build.jsonfor ESM compilationpackage.jsonreact-nativefield:src/index→lib/module/index.jssrc/index.ts,src/Tapjoy.ts,src/TJOfferwallDiscoverView.tsxBreaking Changes
None. This is a bug fix that makes the package work as originally intended.