@multiplekex/shallot 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/runtime.ts +5 -2
package/package.json
CHANGED
package/src/core/runtime.ts
CHANGED
|
@@ -99,6 +99,9 @@ function isWebviewResource(path: string): boolean {
|
|
|
99
99
|
return path.startsWith("/") || path.startsWith("./") || path.startsWith("../");
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
// Dynamic import path to prevent bundler static analysis
|
|
103
|
+
const TAURI_FS_MODULE = "@tauri-apps/" + "plugin-fs";
|
|
104
|
+
|
|
102
105
|
function createStandaloneRuntime(): Runtime {
|
|
103
106
|
return {
|
|
104
107
|
target: "standalone",
|
|
@@ -112,7 +115,7 @@ function createStandaloneRuntime(): Runtime {
|
|
|
112
115
|
return response.text();
|
|
113
116
|
}
|
|
114
117
|
// @ts-ignore - Tauri plugin only available in Tauri context
|
|
115
|
-
const { readTextFile } = await import(/* @vite-ignore */
|
|
118
|
+
const { readTextFile } = await import(/* @vite-ignore */ TAURI_FS_MODULE);
|
|
116
119
|
return readTextFile(path);
|
|
117
120
|
},
|
|
118
121
|
|
|
@@ -125,7 +128,7 @@ function createStandaloneRuntime(): Runtime {
|
|
|
125
128
|
return response.arrayBuffer();
|
|
126
129
|
}
|
|
127
130
|
// @ts-ignore - Tauri plugin only available in Tauri context
|
|
128
|
-
const { readFile } = await import(/* @vite-ignore */
|
|
131
|
+
const { readFile } = await import(/* @vite-ignore */ TAURI_FS_MODULE);
|
|
129
132
|
const bytes = await readFile(path);
|
|
130
133
|
return bytes.buffer;
|
|
131
134
|
},
|