Skip to content

Commit

Permalink
add react fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed May 27, 2020
1 parent 5a50d3f commit 2f61be5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rollup-plugin-react-fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function rollupPluginReactFix() {
return {
name: 'snowpack:rollup-plugin-react-fix',
transform(code, id) {
if (id.endsWith(path.join('react', 'index.js'))) {
if (id.endsWith(path.join('react', 'index.js')) && !code.includes('as __moduleExports')) {
return code + `\nexport { react as __moduleExports };`;
}
},
Expand Down

0 comments on commit 2f61be5

Please sign in to comment.