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

parse fixed for UMD/ESM builds. #485

Merged
merged 2 commits into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/test-cdn/public/demo.esm.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Demo - Moralis Test CDN</title>
<title>🔴 ESM Demo - Moralis Test CDN</title>

<script type="importmap">
{
Expand Down
2 changes: 1 addition & 1 deletion demos/test-cdn/public/demo.umd.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Demo - Moralis Test CDN</title>
<title>🔵 UMD Demo - Moralis Test CDN</title>

<script src="../../../packages/moralis/dist/index.umd.js"></script>
<script src="../../../packages/evmConnectors/EvmWalletconnectConnector/dist/index.umd.js"></script>
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/environment/isTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
* @returns true if the current process is running in a test environment.
*/
export const isTest = (): boolean => {
return process?.env?.NODE_ENV === 'test';
if (typeof process !== 'undefined') {
return process.env?.NODE_ENV === 'test';
}
return false;
};
2 changes: 2 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export function esm(packageJson, internal) {
}),
peerDepsExternal(),
resolve({
browser: true,
preferBuiltins: false,
}),
json(),
Expand Down Expand Up @@ -97,6 +98,7 @@ export function umd(outputName, packageJson, externanMap) {
}),
peerDepsExternal(),
resolve({
browser: true,
preferBuiltins: false,
}),
json(),
Expand Down