Skip to content

Commit

Permalink
fix: inject react shim to the build
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunvegda committed Feb 10, 2023
1 parent 3c44378 commit a20a235
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ dist
node_modules
build
.eslintrc.js
coverage
coverage
react-shim.js
3 changes: 3 additions & 0 deletions react-shim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Why? See - https://github.com/egoist/tsup/issues/792
import React from 'react';
export { React };
3 changes: 3 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ const baseConfig: Options = {
platform: 'node',
outExtension: defaultOutExtension,
esbuildPlugins: defaultEsBuildPlugins,
// TSUP does not appear to be respecting tsconfig's jsx property
// See - https://github.com/egoist/tsup/issues/792
inject: ['./react-shim.js'],
};

const cjsConfig: Options = {
Expand Down

0 comments on commit a20a235

Please sign in to comment.