File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ const { codes: {
3030prepareMainThreadExecution ( false , true ) ;
3131
3232const isLoadingSea = isSea ( ) ;
33+ const isBuiltinWarningNeeded = isLoadingSea && isExperimentalSeaWarningNeeded ( ) ;
3334if ( isExperimentalSeaWarningNeeded ( ) ) {
3435 emitExperimentalWarning ( 'Single executable application' ) ;
3536}
@@ -98,7 +99,7 @@ let warnedAboutBuiltins = false;
9899function embedderRequire ( id ) {
99100 const normalizedId = normalizeRequirableId ( id ) ;
100101 if ( ! normalizedId ) {
101- if ( isLoadingSea && ! warnedAboutBuiltins ) {
102+ if ( isBuiltinWarningNeeded && ! warnedAboutBuiltins ) {
102103 emitWarningSync (
103104 'Currently the require() provided to the main script embedded into ' +
104105 'single-executable applications only supports loading built-in modules.\n' +
Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ const builtinWarning =
1010To load a module from disk after the single executable application is launched, use require("module").createRequire().
1111Support for bundled module loading or virtual file systems are under discussions in https://github.com/nodejs/single-executable` ;
1212
13- expectWarning ( 'Warning' , builtinWarning ) ; // Triggered by require() calls below.
1413// This additionally makes sure that no unexpected warnings are emitted.
1514if ( ! createdRequire ( './sea-config.json' ) . disableExperimentalSEAWarning ) {
15+ expectWarning ( 'Warning' , builtinWarning ) ; // Triggered by require() calls below.
1616 expectWarning ( 'ExperimentalWarning' ,
1717 'Single executable application is an experimental feature and ' +
1818 'might change at any time' ) ;
You can’t perform that action at this time.
0 commit comments