File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ const { codes: {
30
30
prepareMainThreadExecution ( false , true ) ;
31
31
32
32
const isLoadingSea = isSea ( ) ;
33
+ const isBuiltinWarningNeeded = isLoadingSea && isExperimentalSeaWarningNeeded ( ) ;
33
34
if ( isExperimentalSeaWarningNeeded ( ) ) {
34
35
emitExperimentalWarning ( 'Single executable application' ) ;
35
36
}
@@ -98,7 +99,7 @@ let warnedAboutBuiltins = false;
98
99
function embedderRequire ( id ) {
99
100
const normalizedId = normalizeRequirableId ( id ) ;
100
101
if ( ! normalizedId ) {
101
- if ( isLoadingSea && ! warnedAboutBuiltins ) {
102
+ if ( isBuiltinWarningNeeded && ! warnedAboutBuiltins ) {
102
103
emitWarningSync (
103
104
'Currently the require() provided to the main script embedded into ' +
104
105
'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 =
10
10
To load a module from disk after the single executable application is launched, use require("module").createRequire().
11
11
Support for bundled module loading or virtual file systems are under discussions in https://github.com/nodejs/single-executable` ;
12
12
13
- expectWarning ( 'Warning' , builtinWarning ) ; // Triggered by require() calls below.
14
13
// This additionally makes sure that no unexpected warnings are emitted.
15
14
if ( ! createdRequire ( './sea-config.json' ) . disableExperimentalSEAWarning ) {
15
+ expectWarning ( 'Warning' , builtinWarning ) ; // Triggered by require() calls below.
16
16
expectWarning ( 'ExperimentalWarning' ,
17
17
'Single executable application is an experimental feature and ' +
18
18
'might change at any time' ) ;
You can’t perform that action at this time.
0 commit comments