@embroider/core 3.4.3-unstable.ebf92d6 → 3.4.3-unstable.efd9117
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 +4 -4
- package/src/app-files.js.map +1 -1
- package/src/asset.d.ts +0 -2
- package/src/describe-exports.js.map +1 -1
- package/src/ember-html.d.ts +0 -2
- package/src/ember-html.js.map +1 -1
- package/src/html-entrypoint.js.map +1 -1
- package/src/html-placeholder.js.map +1 -1
- package/src/messages.js.map +1 -1
- package/src/module-resolver.d.ts +4 -3
- package/src/module-resolver.js +113 -116
- package/src/module-resolver.js.map +1 -1
- package/src/node-resolve.d.ts +26 -0
- package/src/node-resolve.js +105 -0
- package/src/node-resolve.js.map +1 -0
- package/src/options.js.map +1 -1
- package/src/packager.js.map +1 -1
- package/src/portable-babel-config.js.map +1 -1
- package/src/portable-babel-launcher.js.map +1 -1
- package/src/portable.js.map +1 -1
- package/src/resolver-loader.js.map +1 -1
- package/src/to-broccoli-plugin.js.map +1 -1
- package/src/virtual-content.js.map +1 -1
- package/src/wait-for-trees.js.map +1 -1
package/src/module-resolver.js
CHANGED
@@ -15,59 +15,47 @@ const path_1 = require("path");
|
|
15
15
|
const shared_internals_2 = require("@embroider/shared-internals");
|
16
16
|
const debug_1 = __importDefault(require("debug"));
|
17
17
|
const assert_never_1 = __importDefault(require("assert-never"));
|
18
|
-
const resolve_1 = __importDefault(require("resolve"));
|
19
18
|
const reverse_exports_1 = __importDefault(require("@embroider/reverse-exports"));
|
20
19
|
const virtual_content_1 = require("./virtual-content");
|
21
20
|
const typescript_memoize_1 = require("typescript-memoize");
|
22
21
|
const describe_exports_1 = require("./describe-exports");
|
23
22
|
const fs_1 = require("fs");
|
23
|
+
const node_resolve_1 = require("./node-resolve");
|
24
24
|
const debug = (0, debug_1.default)('embroider:resolver');
|
25
|
+
// Using a formatter makes this work lazy so nothing happens when we aren't
|
26
|
+
// logging. It is unfortunate that formatters are a globally mutable config and
|
27
|
+
// you can only use single character names, but oh well.
|
28
|
+
debug_1.default.formatters.p = (s) => {
|
29
|
+
let cwd = process.cwd();
|
30
|
+
if (s.startsWith(cwd)) {
|
31
|
+
return s.slice(cwd.length + 1);
|
32
|
+
}
|
33
|
+
return s;
|
34
|
+
};
|
25
35
|
function logTransition(reason, before, after = before) {
|
26
36
|
if (after.isVirtual) {
|
27
|
-
debug(`
|
37
|
+
debug(`[%s:virtualized] %s because %s\n in %p`, before.debugType, before.specifier, reason, before.fromFile);
|
28
38
|
}
|
29
39
|
else if (before.specifier !== after.specifier) {
|
30
40
|
if (before.fromFile !== after.fromFile) {
|
31
|
-
debug(`aliased and rehomed
|
41
|
+
debug(`[%s:aliased and rehomed] %s to %s\n because %s\n from %p\n to %p`, before.debugType, before.specifier, after.specifier, reason, before.fromFile, after.fromFile);
|
32
42
|
}
|
33
43
|
else {
|
34
|
-
debug(`aliased
|
44
|
+
debug(`[%s:aliased] %s to %s\n because %s`, before.debugType, before.specifier, after.specifier, reason);
|
35
45
|
}
|
36
46
|
}
|
37
47
|
else if (before.fromFile !== after.fromFile) {
|
38
|
-
debug(`rehomed
|
48
|
+
debug(`[%s:rehomed] %s, because %s\n from %p\n to %p`, before.debugType, before.specifier, reason, before.fromFile, after.fromFile);
|
49
|
+
}
|
50
|
+
else if (after.isNotFound) {
|
51
|
+
debug(`[%s:not-found] %s because %s\n in %p`, before.debugType, before.specifier, reason, before.fromFile);
|
39
52
|
}
|
40
53
|
else {
|
41
|
-
debug(`
|
54
|
+
debug(`[%s:unchanged] %s because %s\n in %p`, before.debugType, before.specifier, reason, before.fromFile);
|
42
55
|
}
|
43
56
|
return after;
|
44
57
|
}
|
45
58
|
const compatPattern = /#embroider_compat\/(?<type>[^\/]+)\/(?<rest>.*)/;
|
46
|
-
class NodeModuleRequest {
|
47
|
-
constructor(specifier, fromFile, isVirtual, meta) {
|
48
|
-
this.specifier = specifier;
|
49
|
-
this.fromFile = fromFile;
|
50
|
-
this.isVirtual = isVirtual;
|
51
|
-
this.meta = meta;
|
52
|
-
}
|
53
|
-
alias(specifier) {
|
54
|
-
return new NodeModuleRequest(specifier, this.fromFile, false, this.meta);
|
55
|
-
}
|
56
|
-
rehome(fromFile) {
|
57
|
-
if (this.fromFile === fromFile) {
|
58
|
-
return this;
|
59
|
-
}
|
60
|
-
else {
|
61
|
-
return new NodeModuleRequest(this.specifier, fromFile, false, this.meta);
|
62
|
-
}
|
63
|
-
}
|
64
|
-
virtualize(filename) {
|
65
|
-
return new NodeModuleRequest(filename, this.fromFile, true, this.meta);
|
66
|
-
}
|
67
|
-
withMeta(meta) {
|
68
|
-
return new NodeModuleRequest(this.specifier, this.fromFile, this.isVirtual, meta);
|
69
|
-
}
|
70
|
-
}
|
71
59
|
class Resolver {
|
72
60
|
constructor(options) {
|
73
61
|
this.options = options;
|
@@ -80,6 +68,9 @@ class Resolver {
|
|
80
68
|
// why we need to know about it.
|
81
69
|
return logTransition('early exit', request);
|
82
70
|
}
|
71
|
+
if (request.specifier === 'require') {
|
72
|
+
return this.external('early require', request, request.specifier);
|
73
|
+
}
|
83
74
|
request = this.handleFastbootSwitch(request);
|
84
75
|
request = this.handleGlobalsCompat(request);
|
85
76
|
request = this.handleImplicitModules(request);
|
@@ -141,10 +132,10 @@ class Resolver {
|
|
141
132
|
if (nextRequest.fromFile === request.fromFile && nextRequest.specifier === request.specifier) {
|
142
133
|
throw new Error('Bug Discovered! New request is not === original request but has the same fromFile and specifier. This will likely create a loop.');
|
143
134
|
}
|
144
|
-
if (nextRequest.isVirtual) {
|
145
|
-
// virtual requests are terminal, there is no more
|
146
|
-
// fallbackResolve around them. The defaultResolve is
|
147
|
-
// to implement them.
|
135
|
+
if (nextRequest.isVirtual || nextRequest.isNotFound) {
|
136
|
+
// virtual and NotFound requests are terminal, there is no more
|
137
|
+
// beforeResolve or fallbackResolve around them. The defaultResolve is
|
138
|
+
// expected to know how to implement them.
|
148
139
|
return yield defaultResolve(nextRequest);
|
149
140
|
}
|
150
141
|
return yield* this.internalResolve(nextRequest, defaultResolve);
|
@@ -153,39 +144,7 @@ class Resolver {
|
|
153
144
|
// top. This is a convenience method for calling resolveSync with the
|
154
145
|
// defaultResolve already configured to be "do the normal node thing".
|
155
146
|
nodeResolve(specifier, fromFile) {
|
156
|
-
|
157
|
-
if (request.isVirtual) {
|
158
|
-
return {
|
159
|
-
type: 'found',
|
160
|
-
result: {
|
161
|
-
type: 'virtual',
|
162
|
-
content: (0, virtual_content_1.virtualContent)(request.specifier, this),
|
163
|
-
filename: request.specifier,
|
164
|
-
},
|
165
|
-
};
|
166
|
-
}
|
167
|
-
try {
|
168
|
-
let filename = resolve_1.default.sync(request.specifier, {
|
169
|
-
basedir: (0, path_1.dirname)(request.fromFile),
|
170
|
-
extensions: this.options.resolvableExtensions,
|
171
|
-
});
|
172
|
-
return { type: 'found', result: { type: 'real', filename } };
|
173
|
-
}
|
174
|
-
catch (err) {
|
175
|
-
if (err.code !== 'MODULE_NOT_FOUND') {
|
176
|
-
throw err;
|
177
|
-
}
|
178
|
-
return { type: 'not_found', err };
|
179
|
-
}
|
180
|
-
});
|
181
|
-
switch (resolution.type) {
|
182
|
-
case 'not_found':
|
183
|
-
return resolution;
|
184
|
-
case 'found':
|
185
|
-
return resolution.result;
|
186
|
-
default:
|
187
|
-
throw (0, assert_never_1.default)(resolution);
|
188
|
-
}
|
147
|
+
return (0, node_resolve_1.nodeResolve)(this, specifier, fromFile);
|
189
148
|
}
|
190
149
|
get packageCache() {
|
191
150
|
return shared_internals_2.RewrittenPackageCache.shared('embroider', this.options.appRoot);
|
@@ -415,10 +374,10 @@ class Resolver {
|
|
415
374
|
parseGlobalPath(path, inEngine) {
|
416
375
|
let parts = path.split('@');
|
417
376
|
if (parts.length > 1 && parts[0].length > 0) {
|
418
|
-
return { packageName: parts[0], memberName: parts[1], from: (0, path_1.resolve)(inEngine.root, '
|
377
|
+
return { packageName: parts[0], memberName: parts[1], from: (0, path_1.resolve)(inEngine.root, 'package.json') };
|
419
378
|
}
|
420
379
|
else {
|
421
|
-
return { packageName: inEngine.packageName, memberName: path, from: (0, path_1.resolve)(inEngine.root, '
|
380
|
+
return { packageName: inEngine.packageName, memberName: path, from: (0, path_1.resolve)(inEngine.root, 'package.json') };
|
422
381
|
}
|
423
382
|
}
|
424
383
|
engineConfig(packageName) {
|
@@ -526,7 +485,7 @@ class Resolver {
|
|
526
485
|
return owningEngine;
|
527
486
|
}
|
528
487
|
handleRewrittenPackages(request) {
|
529
|
-
if (request.isVirtual) {
|
488
|
+
if (request.isVirtual || request.isNotFound) {
|
530
489
|
return request;
|
531
490
|
}
|
532
491
|
let requestingPkg = this.packageCache.ownerOfFile(request.fromFile);
|
@@ -545,10 +504,6 @@ class Resolver {
|
|
545
504
|
targetPkg = this.packageCache.resolve(packageName, requestingPkg);
|
546
505
|
}
|
547
506
|
catch (err) {
|
548
|
-
// this is not the place to report resolution failures. If the thing
|
549
|
-
// doesn't resolve, we're just not interested in redirecting it for
|
550
|
-
// backward-compat, that's all. The rest of the system will take care of
|
551
|
-
// reporting a failure to resolve (or handling it a different way)
|
552
507
|
if (err.code !== 'MODULE_NOT_FOUND') {
|
553
508
|
throw err;
|
554
509
|
}
|
@@ -564,14 +519,26 @@ class Resolver {
|
|
564
519
|
return logTransition('request targets a moved package', request, this.resolveWithinMovedPackage(request, targetPkg));
|
565
520
|
}
|
566
521
|
else if (originalRequestingPkg !== requestingPkg) {
|
567
|
-
|
568
|
-
|
569
|
-
|
522
|
+
if (targetPkg) {
|
523
|
+
// in this case, the requesting package is moved but its destination is
|
524
|
+
// not, so we need to rehome the request back to the original location.
|
525
|
+
return logTransition('outbound request from moved package', request, request
|
526
|
+
// setting meta here because if this fails, we want the fallback
|
527
|
+
// logic to revert our rehome and continue from the *moved* package.
|
528
|
+
.withMeta({ originalFromFile: request.fromFile })
|
529
|
+
.rehome((0, path_1.resolve)(originalRequestingPkg.root, 'package.json')));
|
530
|
+
}
|
531
|
+
else {
|
532
|
+
// requesting package was moved and we failed to find its target. We
|
533
|
+
// can't let that accidentally succeed in the defaultResolve because we
|
534
|
+
// could escape the moved package system.
|
535
|
+
return logTransition('missing outbound request from moved package', request, request.notFound());
|
536
|
+
}
|
570
537
|
}
|
571
538
|
return request;
|
572
539
|
}
|
573
540
|
handleRenaming(request) {
|
574
|
-
if (request.isVirtual) {
|
541
|
+
if (request.isVirtual || request.isNotFound) {
|
575
542
|
return request;
|
576
543
|
}
|
577
544
|
let packageName = (0, shared_internals_1.packageName)(request.specifier);
|
@@ -609,7 +576,10 @@ class Resolver {
|
|
609
576
|
// packages get this help, v2 packages are natively supposed to make their
|
610
577
|
// own modules resolvable, and we want to push them all to do that
|
611
578
|
// correctly.
|
612
|
-
|
579
|
+
// "my-package/foo" -> "./foo"
|
580
|
+
// "my-package" -> "./" (this can't be just "." because node's require.resolve doesn't reliable support that)
|
581
|
+
let selfImportPath = request.specifier === pkg.name ? './' : request.specifier.replace(pkg.name, '.');
|
582
|
+
return logTransition(`v1 self-import`, request, request.alias(selfImportPath).rehome((0, path_1.resolve)(pkg.root, 'package.json')));
|
613
583
|
}
|
614
584
|
return request;
|
615
585
|
}
|
@@ -618,16 +588,17 @@ class Resolver {
|
|
618
588
|
if (pkg.name.startsWith('@')) {
|
619
589
|
levels.push('..');
|
620
590
|
}
|
591
|
+
let originalFromFile = request.fromFile;
|
621
592
|
let newRequest = request.rehome((0, path_1.resolve)(pkg.root, ...levels, 'moved-package-target.js'));
|
622
593
|
if (newRequest === request) {
|
623
594
|
return request;
|
624
595
|
}
|
625
|
-
|
626
|
-
|
627
|
-
});
|
596
|
+
// setting meta because if this fails, we want the fallback to pick up back
|
597
|
+
// in the original requesting package.
|
598
|
+
return newRequest.withMeta({ originalFromFile });
|
628
599
|
}
|
629
600
|
preHandleExternal(request) {
|
630
|
-
if (request.isVirtual) {
|
601
|
+
if (request.isVirtual || request.isNotFound) {
|
631
602
|
return request;
|
632
603
|
}
|
633
604
|
let { specifier, fromFile } = request;
|
@@ -660,7 +631,15 @@ class Resolver {
|
|
660
631
|
// engine
|
661
632
|
let logicalLocation = this.reverseSearchAppTree(pkg, request.fromFile);
|
662
633
|
if (logicalLocation) {
|
663
|
-
return logTransition('beforeResolve: relative import in app-js', request, request
|
634
|
+
return logTransition('beforeResolve: relative import in app-js', request, request
|
635
|
+
.alias('./' + path_1.posix.join((0, path_1.dirname)(logicalLocation.inAppName), request.specifier))
|
636
|
+
// it's important that we're rehoming this to the root of the engine
|
637
|
+
// (which we know really exists), and not to a subdir like
|
638
|
+
// logicalLocation.inAppName (which might not physically exist),
|
639
|
+
// because some environments (including node's require.resolve) will
|
640
|
+
// refuse to do resolution from a notional path that doesn't
|
641
|
+
// physically exist.
|
642
|
+
.rehome((0, path_1.resolve)(logicalLocation.owningEngine.root, 'package.json')));
|
664
643
|
}
|
665
644
|
return request;
|
666
645
|
}
|
@@ -675,11 +654,11 @@ class Resolver {
|
|
675
654
|
if (shared_internals_1.emberVirtualPeerDeps.has(packageName) && !pkg.hasDependency(packageName)) {
|
676
655
|
// addons (whether auto-upgraded or not) may use the app's
|
677
656
|
// emberVirtualPeerDeps, like "@glimmer/component" etc.
|
678
|
-
|
679
|
-
|
657
|
+
let addon = this.locateActiveAddon(packageName);
|
658
|
+
if (!addon) {
|
659
|
+
throw new Error(`${pkg.name} is trying to import the emberVirtualPeerDep "${packageName}", but it seems to be missing`);
|
680
660
|
}
|
681
|
-
|
682
|
-
return logTransition(`emberVirtualPeerDeps in v2 addon`, request, request.rehome(newHome));
|
661
|
+
return logTransition(`emberVirtualPeerDeps`, request, request.rehome(addon.canResolveFromFile));
|
683
662
|
}
|
684
663
|
// if this file is part of an addon's app-js, it's really the logical
|
685
664
|
// package to which it belongs (normally the app) that affects some policy
|
@@ -710,6 +689,22 @@ class Resolver {
|
|
710
689
|
}
|
711
690
|
return request;
|
712
691
|
}
|
692
|
+
locateActiveAddon(packageName) {
|
693
|
+
if (packageName === this.options.modulePrefix) {
|
694
|
+
// the app itself is something that addon's can classically resolve if they know it's name.
|
695
|
+
return {
|
696
|
+
root: this.options.appRoot,
|
697
|
+
canResolveFromFile: (0, path_1.resolve)(this.packageCache.maybeMoved(this.packageCache.get(this.options.appRoot)).root, 'package.json'),
|
698
|
+
};
|
699
|
+
}
|
700
|
+
for (let engine of this.options.engines) {
|
701
|
+
for (let addon of engine.activeAddons) {
|
702
|
+
if (addon.name === packageName) {
|
703
|
+
return addon;
|
704
|
+
}
|
705
|
+
}
|
706
|
+
}
|
707
|
+
}
|
713
708
|
external(label, request, specifier) {
|
714
709
|
if (this.options.amdCompatibility === 'cjs') {
|
715
710
|
let filename = (0, virtual_content_1.virtualExternalCJSModule)(specifier);
|
@@ -743,7 +738,7 @@ class Resolver {
|
|
743
738
|
}
|
744
739
|
}
|
745
740
|
fallbackResolve(request) {
|
746
|
-
var _a
|
741
|
+
var _a;
|
747
742
|
if (request.specifier === '@embroider/macros') {
|
748
743
|
// the macros package is always handled directly within babel (not
|
749
744
|
// necessarily as a real resolvable package), so we should not mess with it.
|
@@ -751,8 +746,7 @@ class Resolver {
|
|
751
746
|
// why we need to know about it.
|
752
747
|
return logTransition('fallback early exit', request);
|
753
748
|
}
|
754
|
-
|
755
|
-
if (compatPattern.test(specifier)) {
|
749
|
+
if (compatPattern.test(request.specifier)) {
|
756
750
|
// Some kinds of compat requests get rewritten into other things
|
757
751
|
// deterministically. For example, "#embroider_compat/helpers/whatever"
|
758
752
|
// means only "the-current-engine/helpers/whatever", and if that doesn't
|
@@ -768,39 +762,33 @@ class Resolver {
|
|
768
762
|
// here.
|
769
763
|
return request;
|
770
764
|
}
|
771
|
-
|
772
|
-
if (!((_a = request.meta) === null || _a === void 0 ? void 0 : _a.resolvedWithinPackage)) {
|
773
|
-
throw new Error(`bug: embroider resolver's meta is not propagating`);
|
774
|
-
}
|
775
|
-
fromFile = (0, path_1.resolve)((_b = request.meta) === null || _b === void 0 ? void 0 : _b.resolvedWithinPackage, 'package.json');
|
776
|
-
}
|
777
|
-
let pkg = this.packageCache.ownerOfFile(fromFile);
|
765
|
+
let pkg = this.packageCache.ownerOfFile(request.fromFile);
|
778
766
|
if (!pkg) {
|
779
767
|
return logTransition('no identifiable owningPackage', request);
|
780
768
|
}
|
781
|
-
//
|
782
|
-
// to
|
783
|
-
//
|
784
|
-
// isV2Ember()
|
769
|
+
// meta.originalFromFile gets set when we want to try to rehome a request
|
770
|
+
// but then come back to the original location here in the fallback when the
|
771
|
+
// rehomed request fails
|
785
772
|
let movedPkg = this.packageCache.maybeMoved(pkg);
|
786
773
|
if (movedPkg !== pkg) {
|
787
|
-
|
774
|
+
let originalFromFile = (_a = request.meta) === null || _a === void 0 ? void 0 : _a.originalFromFile;
|
775
|
+
if (typeof originalFromFile !== 'string') {
|
788
776
|
throw new Error(`bug: embroider resolver's meta is not propagating`);
|
789
777
|
}
|
790
|
-
|
778
|
+
request = request.rehome(originalFromFile);
|
791
779
|
pkg = movedPkg;
|
792
780
|
}
|
793
781
|
if (!pkg.isV2Ember()) {
|
794
782
|
return logTransition('fallbackResolve: not in an ember package', request);
|
795
783
|
}
|
796
|
-
let packageName = (0, shared_internals_1.packageName)(specifier);
|
784
|
+
let packageName = (0, shared_internals_1.packageName)(request.specifier);
|
797
785
|
if (!packageName) {
|
798
786
|
// this is a relative import
|
799
787
|
let withinEngine = this.engineConfig(pkg.name);
|
800
788
|
if (withinEngine) {
|
801
789
|
// it's a relative import inside an engine (which also means app), which
|
802
790
|
// means we may need to satisfy the request via app tree merging.
|
803
|
-
let appJSMatch = this.searchAppTree(request, withinEngine, (0, shared_internals_2.explicitRelative)(pkg.root, (0, path_1.resolve)((0, path_1.dirname)(fromFile), specifier)));
|
791
|
+
let appJSMatch = this.searchAppTree(request, withinEngine, (0, shared_internals_2.explicitRelative)(pkg.root, (0, path_1.resolve)((0, path_1.dirname)(request.fromFile), request.specifier)));
|
804
792
|
if (appJSMatch) {
|
805
793
|
return logTransition('fallbackResolve: relative appJsMatch', request, appJSMatch);
|
806
794
|
}
|
@@ -814,23 +802,32 @@ class Resolver {
|
|
814
802
|
}
|
815
803
|
}
|
816
804
|
// auto-upgraded packages can fall back to the set of known active addons
|
817
|
-
if (pkg.meta['auto-upgraded']
|
818
|
-
|
819
|
-
if (
|
820
|
-
|
805
|
+
if (pkg.meta['auto-upgraded']) {
|
806
|
+
let addon = this.locateActiveAddon(packageName);
|
807
|
+
if (addon) {
|
808
|
+
const rehomed = request.rehome(addon.canResolveFromFile);
|
809
|
+
if (rehomed !== request) {
|
810
|
+
return logTransition(`activeAddons`, request, rehomed);
|
811
|
+
}
|
821
812
|
}
|
822
813
|
}
|
823
|
-
let logicalLocation = this.reverseSearchAppTree(pkg, fromFile);
|
814
|
+
let logicalLocation = this.reverseSearchAppTree(pkg, request.fromFile);
|
824
815
|
if (logicalLocation) {
|
825
816
|
// the requesting file is in an addon's appTree. We didn't succeed in
|
826
817
|
// resolving this (non-relative) request from inside the actual addon, so
|
827
818
|
// next try to resolve it from the corresponding logical location in the
|
828
819
|
// app.
|
829
|
-
return logTransition('fallbackResolve: retry from logical home of app-js file', request,
|
820
|
+
return logTransition('fallbackResolve: retry from logical home of app-js file', request,
|
821
|
+
// it might look more precise to rehome into logicalLocation.inAppName
|
822
|
+
// rather than package.json. But that logical location may not actually
|
823
|
+
// exist, and some systems (including node's require.resolve) will be
|
824
|
+
// mad about trying to resolve from notional paths that don't really
|
825
|
+
// exist.
|
826
|
+
request.rehome((0, path_1.resolve)(logicalLocation.owningEngine.root, 'package.json')));
|
830
827
|
}
|
831
828
|
let targetingEngine = this.engineConfig(packageName);
|
832
829
|
if (targetingEngine) {
|
833
|
-
let appJSMatch = this.searchAppTree(request, targetingEngine, specifier.replace(packageName, '.'));
|
830
|
+
let appJSMatch = this.searchAppTree(request, targetingEngine, request.specifier.replace(packageName, '.'));
|
834
831
|
if (appJSMatch) {
|
835
832
|
return logTransition('fallbackResolve: non-relative appJsMatch', request, appJSMatch);
|
836
833
|
}
|
@@ -840,14 +837,14 @@ class Resolver {
|
|
840
837
|
// runtime. Native v2 packages can only get this behavior in the
|
841
838
|
// isExplicitlyExternal case above because they need to explicitly ask for
|
842
839
|
// externals.
|
843
|
-
return this.external('v1 catch-all fallback', request, specifier);
|
840
|
+
return this.external('v1 catch-all fallback', request, request.specifier);
|
844
841
|
}
|
845
842
|
else {
|
846
843
|
// native v2 packages don't automatically externalize *everything* the way
|
847
844
|
// auto-upgraded packages do, but they still externalize known and approved
|
848
845
|
// ember virtual packages (like @ember/component)
|
849
846
|
if (shared_internals_1.emberVirtualPackages.has(packageName)) {
|
850
|
-
return this.external('emberVirtualPackages', request, specifier);
|
847
|
+
return this.external('emberVirtualPackages', request, request.specifier);
|
851
848
|
}
|
852
849
|
}
|
853
850
|
// this is falling through with the original specifier which was
|