mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Consult babel-runtime package when discarding helper modules.
The most fool-proof way to tell if a module is provided by babel-runtime is to load babel-runtime as an isopacket and ask it. This should fix any remaining issues like this one: https://github.com/meteor/meteor/pull/7668#pullrequestreview-4379559
This commit is contained in:
@@ -771,6 +771,15 @@ class ResourceSlot {
|
||||
}
|
||||
}
|
||||
|
||||
let babelRuntime;
|
||||
function checkBabelRuntimeHelper(id) {
|
||||
if (! babelRuntime) {
|
||||
babelRuntime = require("../tool-env/isopackets.js")
|
||||
.load("runtime")["babel-runtime"];
|
||||
}
|
||||
return babelRuntime.checkHelper(id);
|
||||
}
|
||||
|
||||
export class PackageSourceBatch {
|
||||
constructor(unibuild, processor, {
|
||||
sourceRoot,
|
||||
@@ -1112,10 +1121,7 @@ export class PackageSourceBatch {
|
||||
// relying on programs/server/npm/node_modules/babel-runtime,
|
||||
// but on the web these bundled files are all we have, so we'd
|
||||
// better not remove them.
|
||||
if (parts[0] === "node_modules" &&
|
||||
parts[1] === "babel-runtime" &&
|
||||
(parts[2] === "helpers" ||
|
||||
parts[2].startsWith("regenerator"))) {
|
||||
if (checkBabelRuntimeHelper(file.installPath)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,8 @@ export const ISOPACKETS = {
|
||||
'constraint-solver': ['constraint-solver'],
|
||||
'cordova-support': ['boilerplate-generator', 'logging', 'webapp-hashing',
|
||||
'xmlbuilder'],
|
||||
'logging': ['logging']
|
||||
'logging': ['logging'],
|
||||
'runtime': ['babel-runtime'],
|
||||
};
|
||||
|
||||
// Caches isopackets in memory (each isopacket only needs to be loaded
|
||||
|
||||
Reference in New Issue
Block a user