yysun/apprun

global values created for ESM version

tvardy opened this issue · 1 comments

apprun/src/apprun.ts

Lines 61 to 66 in f16a53d

if (typeof window === 'object') {
window['Component'] = Component;
window['React'] = app;
window['on'] = on;
window['customElement'] = customElement;
}

becomes

apprun/esm/apprun.js

Lines 40 to 45 in f16a53d

if (typeof window === 'object') {
window['Component'] = Component;
window['React'] = app;
window['on'] = on;
window['customElement'] = customElement;
}

I noticed that part accidentally while checking other things... I got surprised that even though I haven't imported the Component in a separate component file, the script was able to find a reference and interpret ... extends Component { without throwing an error.

I guest the ESM version shouldn't expose global variables... this should only show up in the dist

yysun commented

I agree.