Skip to content

Commit 2ee9e76

Browse files
committed
feat(config): remote module security
1 parent 516701f commit 2ee9e76

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

packages/core/config/config.interface.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,26 @@ interface IConfigEmbed extends IConfigEmbedProps {
215215
android?: IConfigEmbedProps;
216216
}
217217

218+
interface ISecurityConfig {
219+
/**
220+
* Enable remote ES module loading in production.
221+
* Default: false
222+
*
223+
* When false, any attempt to import("https://...") in production
224+
* will throw an error.
225+
*/
226+
allowRemoteModules: boolean;
227+
228+
/**
229+
* Restrict remote modules to specific URL prefixes.
230+
* Only used when allowRemoteModules is true.
231+
*
232+
* If empty or not provided, all HTTPS URLs are allowed
233+
* (not recommended for production).
234+
*/
235+
remoteModuleAllowlist?: string[];
236+
}
237+
218238
type BundlerType = 'webpack' | 'vite';
219239

220240
export interface NativeScriptConfig {
@@ -315,4 +335,9 @@ export interface NativeScriptConfig {
315335
* Set project persistent hooks to run
316336
*/
317337
hooks?: IConfigHook[];
338+
339+
/**
340+
* Security configurations
341+
*/
342+
security?: ISecurityConfig;
318343
}

0 commit comments

Comments
 (0)