Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/metro-config/src/defaults/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ const getDefaultValues = (projectRoot: ?string): ConfigT => ({
optimizationSizeLimit: 150 * 1024, // 150 KiB.
transformVariants: {default: {}},
publicPath: '/assets',
allowOptionalDependencies: false,
allowOptionalDependencies: true,
unstable_allowRequireContext: false,
unstable_dependencyMapReservedName: null,
unstable_disableModuleWrapping: false,
unstable_disableNormalizePseudoGlobals: false,
unstable_renameRequire: true,
unstable_renameRequire: false,
unstable_compactOutput: false,
unstable_memoizeInlineRequires: false,
unstable_workerThreads: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ exports[`should build the dependency graph 1`] = `
Array [
Object {
"data": Object {
"code": "__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
"code": "__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
'use strict';

var Bar = _$$_REQUIRE(_dependencyMap[0]);
var Foo = _$$_REQUIRE(_dependencyMap[1]);
var TypeScript = _$$_REQUIRE(_dependencyMap[2]);
var Bar = require(_dependencyMap[0]);
var Foo = require(_dependencyMap[1]);
var TypeScript = require(_dependencyMap[2]);
Object.keys(Object.assign({}, Bar));
module.exports = {
Foo: Foo,
Expand All @@ -25,7 +25,7 @@ Array [
},
"lineCount": 13,
"map": Object {
"mappings": ";EAUA,YAAY;;EAEZ,IAAMA,GAAG,GAAGC,WAAO,CAAAC,cAAA,GAAQ,CAAC;EAC5B,IAAMC,GAAG,GAAGF,WAAO,CAAAC,cAAA,GAAQ,CAAC;EAG5B,IAAME,UAAU,GAAGH,WAAO,CAAAC,cAAA,GAAe,CAAC;EAE1CG,MAAM,CAACC,IAAI,CAAAD,MAAA,CAAAE,MAAA,KAAKP,GAAG,CAAC,CAAC;EAErBQ,MAAM,CAACC,OAAO,GAAG;IAACN,GAAG,EAAHA,GAAG;IAAEH,GAAG,EAAHA,GAAG;IAAEI,UAAU,EAAVA;EAAU,CAAC;AAAC,G",
"mappings": ";EAUA,YAAY;;EAEZ,IAAMA,GAAG,GAAGC,OAAO,CAAAC,cAAA,GAAQ,CAAC;EAC5B,IAAMC,GAAG,GAAGF,OAAO,CAAAC,cAAA,GAAQ,CAAC;EAG5B,IAAME,UAAU,GAAGH,OAAO,CAAAC,cAAA,GAAe,CAAC;EAE1CG,MAAM,CAACC,IAAI,CAAAD,MAAA,CAAAE,MAAA,KAAKP,GAAG,CAAC,CAAC;EAErBQ,MAAM,CAACC,OAAO,GAAG;IAACN,GAAG,EAAHA,GAAG;IAAEH,GAAG,EAAHA,GAAG;IAAEI,UAAU,EAAVA;EAAU,CAAC;AAAC,G",
"names": Array [
"Bar",
"require",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ test('builds a simple bundle', async () => {
expect(match).not.toBeNull();

expect(match[0]).toMatchInlineSnapshot(`
"__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
'use strict';

Object.defineProperty(exports, '__esModule', {
value: true
});
var shouldBeB, shouldBeC;
try {
shouldBeB = _$$_REQUIRE(_dependencyMap[0], \\"./not-exists\\");
shouldBeB = require(_dependencyMap[0], \\"./not-exists\\");
} catch (_unused) {
shouldBeB = _$$_REQUIRE(_dependencyMap[1], \\"./optional-b\\");
shouldBeB = require(_dependencyMap[1], \\"./optional-b\\");
}
(function requireOptionalC() {
try {
shouldBeC = _$$_REQUIRE(_dependencyMap[2], \\"./optional-c\\");
shouldBeC = require(_dependencyMap[2], \\"./optional-c\\");
} catch (e) {}
})();
var a = _$$_REQUIRE(_dependencyMap[3], \\"./required-a\\");
var a = require(_dependencyMap[3], \\"./required-a\\");
var b = shouldBeB;
var c = shouldBeC;
exports.a = a;
Expand Down
Loading