-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix resolving react, refactor exports
closes #3
- Loading branch information
1 parent
9dcb914
commit 63b1e13
Showing
6 changed files
with
106 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
.cache/ | ||
.DS_Store | ||
node_modules/ | ||
/index.cjs | ||
/index.mjs | ||
/lib/ | ||
/react/ | ||
/tests/~partytown/ | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import PartytownSnippet from '@snippet'; | ||
import type { PartytownConfig } from './lib/types'; | ||
|
||
export const partytownSnippet = (config: PartytownConfig) => { | ||
const forward = config.forward || []; | ||
delete config.forward; | ||
|
||
return [ | ||
`(function(w,p,f,c){`, | ||
config && Object.keys(config).length > 0 | ||
? `c=w[p]=Object.assign(w[p]||{},${JSON.stringify(config)});` | ||
: `c=w[p]=w[p]||{};`, | ||
`c[f]=(c[f]||[])`, | ||
forward.length > 0 ? `.concat(${JSON.stringify(forward)})` : ``, | ||
`})(window,'partytown','forward');`, | ||
PartytownSnippet, | ||
].join(''); | ||
}; |
File renamed without changes.
This file contains 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
63b1e13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: