Skip to content

Commit 05e0850

Browse files
committed
sea: suppress builtin warning with disableExperimentalSEAWarning option
Signed-off-by: koooge <[email protected]>
1 parent ff51d83 commit 05e0850

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/internal/main/embedding.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ let warnedAboutBuiltins = false;
9898
function embedderRequire(id) {
9999
const normalizedId = normalizeRequirableId(id);
100100
if (!normalizedId) {
101-
if (isLoadingSea && !warnedAboutBuiltins) {
101+
if (isLoadingSea && isExperimentalSeaWarningNeeded && !warnedAboutBuiltins) {
102102
emitWarningSync(
103103
'Currently the require() provided to the main script embedded into ' +
104104
'single-executable applications only supports loading built-in modules.\n' +

test/fixtures/sea.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ const builtinWarning =
1010
To load a module from disk after the single executable application is launched, use require("module").createRequire().
1111
Support 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.
1514
if (!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');

0 commit comments

Comments
 (0)