Skip to content

Commit dced104

Browse files
Nikola HristovNikola Hristov
authored andcommitted
build: Implement Bundle environment variable for conditional asset handling
Introduce a new 'Bundle' environment variable to control asset inclusion and build configuration. When enabled, worker scripts are imported directly from @CodeEditorLand packages rather than being copied as separate files. - Restructured astro.config.ts to use centralized Static configuration object - Added conditional logic for pushing different vite-static-copy targets based on Bundle flag - Updated Application.astro to use Bundle check instead of NODE_ENV/TAURI_ENV_DEBUG - Simplified script inclusion with direct imports when bundled - Maintained existing file copy behavior for non-bundled environments - Exported Host and Static configuration for better maintainability This change enables more flexible build configurations and prepares the project for different deployment scenarios by decoupling environment checks from asset handling logic.
1 parent 2308e4a commit dced104

3,579 files changed

Lines changed: 86 additions & 9074 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Source/pages/Application.astro

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ const Default = {
147147
const Bust = (Base: string): string =>
148148
`${Base}${Base.includes("?") ? "&" : "?"}v=${encodeURIComponent(Date.now())}`;
149149
150-
const On =
151-
process.env["NODE_ENV"] === "development" ||
152-
process.env["TAURI_ENV_DEBUG"] === "true";
150+
const Bundle = typeof process.env["Bundle"] !== "undefined";
153151
---
154152

155153
<Layout>
@@ -164,13 +162,6 @@ const On =
164162
globalThis._VSCODE_FILE_ROOT = `${Site}/Static/Application/`;
165163
</script>
166164

167-
<script
168-
is:inline
169-
type="module"
170-
src={Bust("/Worker/CSS/Load.js")}
171-
slot="Head"
172-
defer></script>
173-
174165
<script
175166
is:inline
176167
type="module"
@@ -181,31 +172,48 @@ const On =
181172
window._WORKER = Worker;
182173
</script>
183174

184-
<script is:inline type="module" src={Bust("/Worker/Policy.js")} slot="Head"
185-
></script>
186-
187-
<script
188-
is:inline
189-
type="module"
190-
src={Bust("/Worker/Register.js")}
191-
slot="Head"
192-
defer></script>
193-
194175
{
195-
On ? (
196-
<script
197-
is:inline
198-
type="module"
199-
src={Bust(
200-
"/Static/Application/vs/code/browser/workbench/workbench.js",
201-
)}
202-
defer
203-
/>
204-
) : (
176+
Bundle ? (
205177
<script>
206-
import
178+
import "@codeeditorland/Worker/Target/Worker/CSS/Load.js";
179+
import "@codeeditorland/Worker/Target/Worker/Policy.js"; import
180+
"@codeeditorland/Worker/Target/Worker/Register.js"; import
207181
"@codeeditorland/output/Target/Microsoft/VSCode/vs/code/browser/workbench/workbench.js";
208182
</script>
183+
) : (
184+
<Fragment>
185+
<script
186+
is:inline
187+
type="module"
188+
src={Bust("/Worker/CSS/Load.js")}
189+
slot="Head"
190+
defer
191+
/>
192+
193+
<script
194+
is:inline
195+
type="module"
196+
src={Bust("/Worker/Policy.js")}
197+
slot="Head"
198+
/>
199+
200+
<script
201+
is:inline
202+
type="module"
203+
src={Bust("/Worker/Register.js")}
204+
slot="Head"
205+
defer
206+
/>
207+
208+
<script
209+
is:inline
210+
type="module"
211+
src={Bust(
212+
"/Static/Application/vs/code/browser/workbench/workbench.js",
213+
)}
214+
defer
215+
/>
216+
</Fragment>
209217
)
210218
}
211219
</Layout>

Target/Application/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html class=no-js data-beasties-container dir=ltr lang=en><head><script type=module>document.documentElement.classList.remove("no-js"),document.documentElement.classList.add("js")</script><title></title><meta charset=utf-8><meta content name=description><meta content="width=device-width,initial-scale=1" name=viewport><meta content=#ffffff name=theme-color><meta content="telephone=no" name=format-detection><meta content=on name=twitter:dnt><meta data-settings={&#34;remoteAuthority&#34;:&#34;&#34;,&#34;serverBasePath&#34;:&#34;/&#34;,&#34;connectionToken&#34;:&#34;&#34;,&#34;enableWorkspaceTrust&#34;:true,&#34;settingsSyncOptions&#34;:{&#34;enabled&#34;:false},&#34;productConfiguration&#34;:{&#34;embedderIdentifier&#34;:&#34;desktop&#34;,&#34;nameShort&#34;:&#34;FIDDEE&#34;,&#34;nameLong&#34;:&#34;FIDDEE&#34;,&#34;applicationName&#34;:&#34;fiddee&#34;},&#34;developmentOptions&#34;:{&#34;logLevel&#34;:2,&#34;enableSmokeTestDriver&#34;:false}} id=vscode-workbench-web-configuration><link href=/Manifest.json rel=manifest crossorigin=use-credentials><script type=module>const Site="https://tauri.localhost/";globalThis._VSCODE_FILE_ROOT=`${Site}/Static/Application/`</script><script type=module src="/Worker/CSS/Load.js?v=1746323690121" defer=defer></script><script type=module>const Worker="/Worker.js?BASE_REMOTE=https%3A%2F%2Ftauri.localhost%2F&v=1746323690121";window._WORKER=Worker</script><script type=module src="/Worker/Policy.js?v=1746323690121"></script><script type=module src="/Worker/Register.js?v=1746323690121" defer=defer></script><style>:root{--vscode-sash-size:4px;--vscode-sash-hover-size:4px}@property --chat-editing-last-edit-shift{syntax:"<percentage>";initial-value:100%;inherits:false}@property --inline-chat-frame-progress{syntax:"<percentage>";initial-value:0%;inherits:false}body{height:100%;width:100%;margin:0;padding:0;overflow:hidden;font-size:11px;user-select:none;-webkit-user-select:none}</style><link href=/_astro/Application.CRM72xFj.css rel=stylesheet media=print onload="this.media=&#34;all&#34;"><noscript><link href=/_astro/Application.CRM72xFj.css rel=stylesheet></noscript></head><body aria-label><script type=module src=/_astro/Application.astro_astro_type_script_index_0_lang.DUbb6N5r.js></script></body></html>
1+
<!DOCTYPE html><html class=no-js data-beasties-container dir=ltr lang=en><head><script type=module>document.documentElement.classList.remove("no-js"),document.documentElement.classList.add("js")</script><title></title><meta charset=utf-8><meta content name=description><meta content="width=device-width,initial-scale=1" name=viewport><meta content=#ffffff name=theme-color><meta content="telephone=no" name=format-detection><meta content=on name=twitter:dnt><meta data-settings={&#34;remoteAuthority&#34;:&#34;&#34;,&#34;serverBasePath&#34;:&#34;/&#34;,&#34;connectionToken&#34;:&#34;&#34;,&#34;enableWorkspaceTrust&#34;:true,&#34;settingsSyncOptions&#34;:{&#34;enabled&#34;:false},&#34;productConfiguration&#34;:{&#34;embedderIdentifier&#34;:&#34;desktop&#34;,&#34;nameShort&#34;:&#34;FIDDEE&#34;,&#34;nameLong&#34;:&#34;FIDDEE&#34;,&#34;applicationName&#34;:&#34;fiddee&#34;},&#34;developmentOptions&#34;:{&#34;logLevel&#34;:2,&#34;enableSmokeTestDriver&#34;:false}} id=vscode-workbench-web-configuration><link href=/Manifest.json rel=manifest crossorigin=use-credentials><script type=module>const Site="https://tauri.localhost/";globalThis._VSCODE_FILE_ROOT=`${Site}/Static/Application/`</script><script type=module>const Worker="/Worker.js?BASE_REMOTE=https%3A%2F%2Ftauri.localhost%2F&v=1746360288555";window._WORKER=Worker</script><style>:root{--vscode-sash-size:4px;--vscode-sash-hover-size:4px}@property --chat-editing-last-edit-shift{syntax:"<percentage>";initial-value:100%;inherits:false}@property --inline-chat-frame-progress{syntax:"<percentage>";initial-value:0%;inherits:false}body{height:100%;width:100%;margin:0;padding:0;overflow:hidden;font-size:11px;user-select:none;-webkit-user-select:none}</style><link href=/_astro/Application.CRM72xFj.css rel=stylesheet media=print onload="this.media=&#34;all&#34;"><noscript><link href=/_astro/Application.CRM72xFj.css rel=stylesheet></noscript></head><body aria-label><script type=module src=/_astro/Application.astro_astro_type_script_index_0_lang.DnA6Um2E.js></script></body></html>

Target/Static/Application/bootstrap-esm.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

Target/Static/Application/bootstrap-import.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

Target/Static/Application/bootstrap-meta.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

Target/Static/Application/bootstrap-window.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)