mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
chore: Clarify usage of window fields in index.js
/puter/src/index.js 58:15 error 'loadScript' is not defined no-undef 59:15 error 'loadScript' is not defined no-undef 65:13 error 'gui_env' is not defined no-undef 66:15 error 'loadScript' is not defined no-undef 68:15 error 'loadCSS' is not defined no-undef 69:15 error 'loadScript' is not defined no-undef 73:5 error 'initgui' is not defined no-undef
This commit is contained in:
parent
5198081c2b
commit
23d959bf64
14
src/index.js
14
src/index.js
@ -55,22 +55,22 @@ window.gui = async function(options){
|
||||
|
||||
// DEV: Load the initgui.js file if we are in development mode
|
||||
if(!window.gui_env || window.gui_env === "dev"){
|
||||
await loadScript('/sdk/puter.dev.js');
|
||||
await loadScript('/initgui.js', {isModule: true});
|
||||
await window.loadScript('/sdk/puter.dev.js');
|
||||
await window.loadScript('/initgui.js', {isModule: true});
|
||||
}
|
||||
|
||||
// PROD: load the minified bundles if we are in production mode
|
||||
// note: the order of the bundles is important
|
||||
// note: Build script will prepend `window.gui_env="prod"` to the top of the file
|
||||
else if(gui_env === "prod"){
|
||||
await loadScript('https://js.puter.com/v2/');
|
||||
else if(window.gui_env === "prod"){
|
||||
await window.loadScript('https://js.puter.com/v2/');
|
||||
// Load the minified bundles
|
||||
await loadCSS('/dist/bundle.min.css');
|
||||
await loadScript('/dist/bundle.min.js');
|
||||
await window.loadCSS('/dist/bundle.min.css');
|
||||
await window.loadScript('/dist/bundle.min.js');
|
||||
}
|
||||
|
||||
// 🚀 Launch the GUI 🚀
|
||||
initgui();
|
||||
window.initgui();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user