@expo/metro-config 0.17.2 → 0.17.4
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/build/ExpoMetroConfig.js +239 -366
- package/build/ExpoMetroConfig.js.map +1 -1
- package/build/babel-core.js +6 -23
- package/build/babel-core.js.map +1 -1
- package/build/babel-transformer.js +117 -162
- package/build/babel-transformer.js.map +1 -1
- package/build/customizeFrame.js +84 -78
- package/build/customizeFrame.js.map +1 -1
- package/build/env.js +23 -37
- package/build/env.js.map +1 -1
- package/build/file-store.js +13 -21
- package/build/file-store.js.map +1 -1
- package/build/getModulesPaths.js +31 -48
- package/build/getModulesPaths.js.map +1 -1
- package/build/getWatchFolders.js +70 -98
- package/build/getWatchFolders.js.map +1 -1
- package/build/loadBabelConfig.js +30 -49
- package/build/loadBabelConfig.js.map +1 -1
- package/build/rewriteRequestUrl.js +82 -142
- package/build/rewriteRequestUrl.js.map +1 -1
- package/build/serializer/debugId.js +23 -22
- package/build/serializer/debugId.js.map +1 -1
- package/build/serializer/environmentVariableSerializerPlugin.js +90 -101
- package/build/serializer/environmentVariableSerializerPlugin.js.map +1 -1
- package/build/serializer/exportHermes.js +96 -133
- package/build/serializer/exportHermes.js.map +1 -1
- package/build/serializer/exportPath.js +18 -35
- package/build/serializer/exportPath.js.map +1 -1
- package/build/serializer/fork/baseJSBundle.js +124 -147
- package/build/serializer/fork/baseJSBundle.js.map +1 -1
- package/build/serializer/fork/js.js +81 -116
- package/build/serializer/fork/js.js.map +1 -1
- package/build/serializer/fork/processModules.js +22 -36
- package/build/serializer/fork/processModules.js.map +1 -1
- package/build/serializer/getCssDeps.js +64 -95
- package/build/serializer/getCssDeps.js.map +1 -1
- package/build/serializer/jsOutput.js +6 -16
- package/build/serializer/jsOutput.js.map +1 -1
- package/build/serializer/serializeChunks.js +406 -483
- package/build/serializer/serializeChunks.js.map +1 -1
- package/build/serializer/serializerAssets.js +1 -0
- package/build/serializer/serializerAssets.js.map +1 -1
- package/build/serializer/withExpoSerializers.js +165 -236
- package/build/serializer/withExpoSerializers.js.map +1 -1
- package/build/transform-worker/asset-transformer.js +21 -44
- package/build/transform-worker/asset-transformer.js.map +1 -1
- package/build/transform-worker/css-modules.js +57 -84
- package/build/transform-worker/css-modules.js.map +1 -1
- package/build/transform-worker/css.js +21 -20
- package/build/transform-worker/css.js.map +1 -1
- package/build/transform-worker/getAssets.js +38 -75
- package/build/transform-worker/getAssets.js.map +1 -1
- package/build/transform-worker/metro-transform-worker.js +384 -489
- package/build/transform-worker/metro-transform-worker.js.map +1 -1
- package/build/transform-worker/postcss.js +176 -233
- package/build/transform-worker/postcss.js.map +1 -1
- package/build/transform-worker/sass.js +30 -38
- package/build/transform-worker/sass.js.map +1 -1
- package/build/transform-worker/transform-worker.js +156 -188
- package/build/transform-worker/transform-worker.js.map +1 -1
- package/build/transform-worker/utils/require.js +30 -28
- package/build/transform-worker/utils/require.js.map +1 -1
- package/build/transformSync.js +40 -28
- package/build/transformSync.js.map +1 -1
- package/build/transformer/createExoticTransformer.js +96 -129
- package/build/transformer/createExoticTransformer.js.map +1 -1
- package/build/transformer/createMatcher.js +37 -46
- package/build/transformer/createMatcher.js.map +1 -1
- package/build/transformer/createMultiRuleTransformer.js +170 -240
- package/build/transformer/createMultiRuleTransformer.js.map +1 -1
- package/build/transformer/generateFunctionMap.js +20 -23
- package/build/transformer/generateFunctionMap.js.map +1 -1
- package/build/transformer/getBabelConfig.js +94 -127
- package/build/transformer/getBabelConfig.js.map +1 -1
- package/build/transformer/getCacheKey.js +17 -31
- package/build/transformer/getCacheKey.js.map +1 -1
- package/build/transformer/index.js +11 -62
- package/build/transformer/index.js.map +1 -1
- package/build/transformer/metro-expo-exotic-babel-transformer.js +3 -12
- package/build/transformer/metro-expo-exotic-babel-transformer.js.map +1 -1
- package/build/traveling/metro-config.js +12 -19
- package/build/traveling/metro-config.js.map +1 -1
- package/build/utils/hash.js +8 -14
- package/build/utils/hash.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,31 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getBabelConfig = getBabelConfig;
|
|
7
|
-
function _fs() {
|
|
8
|
-
const data = _interopRequireDefault(require("fs"));
|
|
9
|
-
_fs = function () {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _path() {
|
|
15
|
-
const data = _interopRequireDefault(require("path"));
|
|
16
|
-
_path = function () {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
function _resolveFrom() {
|
|
22
|
-
const data = _interopRequireDefault(require("resolve-from"));
|
|
23
|
-
_resolveFrom = function () {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
2
|
/**
|
|
30
3
|
* Copyright (c) Expo.
|
|
31
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -35,117 +8,111 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
35
8
|
*
|
|
36
9
|
* Forks the default metro-react-native-babel-transformer and adds support for known transforms.
|
|
37
10
|
*/
|
|
38
|
-
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getBabelConfig = void 0;
|
|
16
|
+
const fs_1 = __importDefault(require("fs"));
|
|
17
|
+
const path_1 = __importDefault(require("path"));
|
|
18
|
+
const resolve_from_1 = __importDefault(require("resolve-from"));
|
|
39
19
|
/**
|
|
40
20
|
* Return a memoized function that checks for the existence of a
|
|
41
21
|
* project level .babelrc file, and if it doesn't exist, reads the
|
|
42
22
|
* default RN babelrc file and uses that.
|
|
43
23
|
*/
|
|
44
|
-
const getBabelRC = function () {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
24
|
+
const getBabelRC = (function () {
|
|
25
|
+
let babelRC = null;
|
|
26
|
+
return function _getBabelRC(projectRoot, options) {
|
|
27
|
+
if (babelRC != null) {
|
|
28
|
+
return babelRC;
|
|
29
|
+
}
|
|
30
|
+
babelRC = { plugins: [] };
|
|
31
|
+
// Let's look for a babel config file in the project root.
|
|
32
|
+
// TODO look into adding a command line option to specify this location
|
|
33
|
+
let projectBabelRCPath;
|
|
34
|
+
// .babelrc
|
|
35
|
+
if (projectRoot) {
|
|
36
|
+
projectBabelRCPath = path_1.default.resolve(projectRoot, '.babelrc');
|
|
37
|
+
}
|
|
38
|
+
if (projectBabelRCPath) {
|
|
39
|
+
// .babelrc.js
|
|
40
|
+
if (!fs_1.default.existsSync(projectBabelRCPath)) {
|
|
41
|
+
projectBabelRCPath = path_1.default.resolve(projectRoot, '.babelrc.js');
|
|
42
|
+
}
|
|
43
|
+
// babel.config.js
|
|
44
|
+
if (!fs_1.default.existsSync(projectBabelRCPath)) {
|
|
45
|
+
projectBabelRCPath = path_1.default.resolve(projectRoot, 'babel.config.js');
|
|
46
|
+
}
|
|
47
|
+
// If we found a babel config file, extend our config off of it
|
|
48
|
+
// otherwise the default config will be used
|
|
49
|
+
if (fs_1.default.existsSync(projectBabelRCPath)) {
|
|
50
|
+
babelRC.extends = projectBabelRCPath;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// If a babel config file doesn't exist in the project then
|
|
54
|
+
// the default preset for react-native will be used instead.
|
|
55
|
+
if (!babelRC.extends) {
|
|
56
|
+
const { experimentalImportSupport, ...presetOptions } = options;
|
|
57
|
+
// Use `babel-preset-expo` instead of `@react-native/babel-preset`.
|
|
58
|
+
const presetPath = resolve_from_1.default.silent(projectRoot, 'babel-preset-expo') ??
|
|
59
|
+
resolve_from_1.default.silent(projectRoot, '@react-native/babel-preset') ??
|
|
60
|
+
require.resolve('babel-preset-expo');
|
|
61
|
+
babelRC.presets = [
|
|
62
|
+
[
|
|
63
|
+
require(presetPath),
|
|
64
|
+
{
|
|
65
|
+
// Default to React 17 automatic JSX transform.
|
|
66
|
+
jsxRuntime: 'automatic',
|
|
67
|
+
...presetOptions,
|
|
68
|
+
disableImportExportTransform: experimentalImportSupport,
|
|
69
|
+
enableBabelRuntime: options.enableBabelRuntime,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
return babelRC;
|
|
52
75
|
};
|
|
53
|
-
|
|
54
|
-
// Let's look for a babel config file in the project root.
|
|
55
|
-
// TODO look into adding a command line option to specify this location
|
|
56
|
-
let projectBabelRCPath;
|
|
57
|
-
|
|
58
|
-
// .babelrc
|
|
59
|
-
if (projectRoot) {
|
|
60
|
-
projectBabelRCPath = _path().default.resolve(projectRoot, '.babelrc');
|
|
61
|
-
}
|
|
62
|
-
if (projectBabelRCPath) {
|
|
63
|
-
// .babelrc.js
|
|
64
|
-
if (!_fs().default.existsSync(projectBabelRCPath)) {
|
|
65
|
-
projectBabelRCPath = _path().default.resolve(projectRoot, '.babelrc.js');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// babel.config.js
|
|
69
|
-
if (!_fs().default.existsSync(projectBabelRCPath)) {
|
|
70
|
-
projectBabelRCPath = _path().default.resolve(projectRoot, 'babel.config.js');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// If we found a babel config file, extend our config off of it
|
|
74
|
-
// otherwise the default config will be used
|
|
75
|
-
if (_fs().default.existsSync(projectBabelRCPath)) {
|
|
76
|
-
babelRC.extends = projectBabelRCPath;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// If a babel config file doesn't exist in the project then
|
|
81
|
-
// the default preset for react-native will be used instead.
|
|
82
|
-
if (!babelRC.extends) {
|
|
83
|
-
var _ref, _resolveFrom$silent;
|
|
84
|
-
const {
|
|
85
|
-
experimentalImportSupport,
|
|
86
|
-
...presetOptions
|
|
87
|
-
} = options;
|
|
88
|
-
|
|
89
|
-
// Use `babel-preset-expo` instead of `@react-native/babel-preset`.
|
|
90
|
-
const presetPath = (_ref = (_resolveFrom$silent = _resolveFrom().default.silent(projectRoot, 'babel-preset-expo')) !== null && _resolveFrom$silent !== void 0 ? _resolveFrom$silent : _resolveFrom().default.silent(projectRoot, '@react-native/babel-preset')) !== null && _ref !== void 0 ? _ref : require.resolve('babel-preset-expo');
|
|
91
|
-
babelRC.presets = [[require(presetPath), {
|
|
92
|
-
// Default to React 17 automatic JSX transform.
|
|
93
|
-
jsxRuntime: 'automatic',
|
|
94
|
-
...presetOptions,
|
|
95
|
-
disableImportExportTransform: experimentalImportSupport,
|
|
96
|
-
enableBabelRuntime: options.enableBabelRuntime
|
|
97
|
-
}]];
|
|
98
|
-
}
|
|
99
|
-
return babelRC;
|
|
100
|
-
};
|
|
101
|
-
}();
|
|
102
|
-
|
|
76
|
+
})();
|
|
103
77
|
/**
|
|
104
78
|
* Given a filename and options, build a Babel
|
|
105
79
|
* config object with the appropriate plugins.
|
|
106
80
|
*/
|
|
107
81
|
function getBabelConfig(filename, options, plugins = []) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
// TODO: This probably can be removed
|
|
124
|
-
if (options.inlineRequires) {
|
|
125
|
-
const inlineRequiresPlugin = (0, _resolveFrom().default)(options.projectRoot, 'babel-preset-fbjs/plugins/inline-requires');
|
|
126
|
-
extraPlugins.push(inlineRequiresPlugin);
|
|
127
|
-
}
|
|
128
|
-
config.plugins = extraPlugins.concat(config.plugins, plugins);
|
|
129
|
-
if (options.dev && options.hot) {
|
|
130
|
-
// Note: this intentionally doesn't include the path separator because
|
|
131
|
-
// I'm not sure which one it should use on Windows, and false positives
|
|
132
|
-
// are unlikely anyway. If you later decide to include the separator,
|
|
133
|
-
// don't forget that the string usually *starts* with "node_modules" so
|
|
134
|
-
// the first one often won't be there.
|
|
135
|
-
// TODO: Support monorepos
|
|
136
|
-
const mayContainEditableReactComponents = filename.indexOf('node_modules') === -1;
|
|
137
|
-
if (mayContainEditableReactComponents) {
|
|
138
|
-
if (!config.plugins) {
|
|
139
|
-
config.plugins = [];
|
|
140
|
-
}
|
|
141
|
-
// Add react refresh runtime.
|
|
142
|
-
// NOTICE: keep in sync with '@react-native/babel-preset/src/configs/hmr'.
|
|
143
|
-
config.plugins.push(_resolveFrom().default.silent(options.projectRoot, 'react-refresh/babel'));
|
|
82
|
+
const babelRC = getBabelRC(options.projectRoot, options);
|
|
83
|
+
const extraConfig = {
|
|
84
|
+
babelrc: typeof options.enableBabelRCLookup === 'boolean' ? options.enableBabelRCLookup : true,
|
|
85
|
+
code: false,
|
|
86
|
+
filename,
|
|
87
|
+
highlightCode: true,
|
|
88
|
+
};
|
|
89
|
+
const config = { ...babelRC, ...extraConfig };
|
|
90
|
+
// Add extra plugins
|
|
91
|
+
const extraPlugins = [];
|
|
92
|
+
// TODO: This probably can be removed
|
|
93
|
+
if (options.inlineRequires) {
|
|
94
|
+
const inlineRequiresPlugin = (0, resolve_from_1.default)(options.projectRoot, 'babel-preset-fbjs/plugins/inline-requires');
|
|
95
|
+
extraPlugins.push(inlineRequiresPlugin);
|
|
144
96
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
97
|
+
config.plugins = extraPlugins.concat(config.plugins, plugins);
|
|
98
|
+
if (options.dev && options.hot) {
|
|
99
|
+
// Note: this intentionally doesn't include the path separator because
|
|
100
|
+
// I'm not sure which one it should use on Windows, and false positives
|
|
101
|
+
// are unlikely anyway. If you later decide to include the separator,
|
|
102
|
+
// don't forget that the string usually *starts* with "node_modules" so
|
|
103
|
+
// the first one often won't be there.
|
|
104
|
+
// TODO: Support monorepos
|
|
105
|
+
const mayContainEditableReactComponents = filename.indexOf('node_modules') === -1;
|
|
106
|
+
if (mayContainEditableReactComponents) {
|
|
107
|
+
if (!config.plugins) {
|
|
108
|
+
config.plugins = [];
|
|
109
|
+
}
|
|
110
|
+
// Add react refresh runtime.
|
|
111
|
+
// NOTICE: keep in sync with '@react-native/babel-preset/src/configs/hmr'.
|
|
112
|
+
config.plugins.push(resolve_from_1.default.silent(options.projectRoot, 'react-refresh/babel'));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return { ...babelRC, ...config };
|
|
150
116
|
}
|
|
117
|
+
exports.getBabelConfig = getBabelConfig;
|
|
151
118
|
//# sourceMappingURL=getBabelConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBabelConfig.js","
|
|
1
|
+
{"version":3,"file":"getBabelConfig.js","sourceRoot":"","sources":["../../src/transformer/getBabelConfig.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;AAGH,4CAAoB;AAEpB,gDAAwB;AACxB,gEAAuC;AAEvC;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC;IAClB,IAAI,OAAO,GAMA,IAAI,CAAC;IAEhB,OAAO,SAAS,WAAW,CAAC,WAAmB,EAAE,OAAgC;QAC/E,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,OAAO,CAAC;SAChB;QAED,OAAO,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAE1B,0DAA0D;QAC1D,uEAAuE;QACvE,IAAI,kBAAkB,CAAC;QAEvB,WAAW;QACX,IAAI,WAAW,EAAE;YACf,kBAAkB,GAAG,cAAI,CAAC,OAAO,CAAC,WAAW,EAAE,UAA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;KACF;IAED,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC;AACnC,CAAC;AAlDD,wCAkDC"}
|
|
@@ -1,37 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.cacheKeyParts = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function _fs() {
|
|
16
|
-
const data = require("fs");
|
|
17
|
-
_fs = function () {
|
|
18
|
-
return data;
|
|
19
|
-
};
|
|
20
|
-
return data;
|
|
21
|
-
}
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
const cacheKeyParts = [(0, _fs().readFileSync)(__filename),
|
|
24
|
-
// Since babel-preset-fbjs cannot be safely resolved relative to the
|
|
25
|
-
// project root, use this environment variable that we define earlier.
|
|
26
|
-
process.env.EXPO_METRO_CACHE_KEY_VERSION || '3.3.0'
|
|
27
|
-
// require('babel-preset-fbjs/package.json').version,
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getCacheKey = exports.cacheKeyParts = void 0;
|
|
7
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
exports.cacheKeyParts = [
|
|
10
|
+
(0, fs_1.readFileSync)(__filename),
|
|
11
|
+
// Since babel-preset-fbjs cannot be safely resolved relative to the
|
|
12
|
+
// project root, use this environment variable that we define earlier.
|
|
13
|
+
process.env.EXPO_METRO_CACHE_KEY_VERSION || '3.3.0',
|
|
14
|
+
// require('babel-preset-fbjs/package.json').version,
|
|
28
15
|
];
|
|
29
|
-
|
|
30
16
|
// Matches upstream
|
|
31
|
-
exports.cacheKeyParts = cacheKeyParts;
|
|
32
17
|
function getCacheKey() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
const key = crypto_1.default.createHash('md5');
|
|
19
|
+
exports.cacheKeyParts.forEach((part) => key.update(part));
|
|
20
|
+
return key.digest('hex');
|
|
36
21
|
}
|
|
22
|
+
exports.getCacheKey = getCacheKey;
|
|
37
23
|
//# sourceMappingURL=getCacheKey.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCacheKey.js","
|
|
1
|
+
{"version":3,"file":"getCacheKey.js","sourceRoot":"","sources":["../../src/transformer/getCacheKey.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,2BAAkC;AAErB,QAAA,aAAa,GAAG;IAC3B,IAAA,iBAAY,EAAC,UAAU,CAAC;IACxB,oEAAoE;IACpE,sEAAsE;IACtE,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,OAAO;IACnD,uDAAuD;CACxD,CAAC;AAEF,mBAAmB;AACnB,SAAgB,WAAW;IACzB,MAAM,GAAG,GAAG,gBAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACrC,qBAAa,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAJD,kCAIC"}
|
|
@@ -1,64 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, "createModuleMatcher", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _createMatcher().createModuleMatcher;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "createMultiRuleTransformer", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _createMultiRuleTransformer().createMultiRuleTransformer;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "getCacheKey", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _getCacheKey().getCacheKey;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "loaders", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _createMultiRuleTransformer().loaders;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
function _createExoticTransformer() {
|
|
37
|
-
const data = require("./createExoticTransformer");
|
|
38
|
-
_createExoticTransformer = function () {
|
|
39
|
-
return data;
|
|
40
|
-
};
|
|
41
|
-
return data;
|
|
42
|
-
}
|
|
43
|
-
function _getCacheKey() {
|
|
44
|
-
const data = require("./getCacheKey");
|
|
45
|
-
_getCacheKey = function () {
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
48
|
-
return data;
|
|
49
|
-
}
|
|
50
|
-
function _createMultiRuleTransformer() {
|
|
51
|
-
const data = require("./createMultiRuleTransformer");
|
|
52
|
-
_createMultiRuleTransformer = function () {
|
|
53
|
-
return data;
|
|
54
|
-
};
|
|
55
|
-
return data;
|
|
56
|
-
}
|
|
57
|
-
function _createMatcher() {
|
|
58
|
-
const data = require("./createMatcher");
|
|
59
|
-
_createMatcher = function () {
|
|
60
|
-
return data;
|
|
61
|
-
};
|
|
62
|
-
return data;
|
|
63
|
-
}
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createModuleMatcher = exports.createMultiRuleTransformer = exports.loaders = exports.getCacheKey = exports.createExoticTransformer = void 0;
|
|
4
|
+
var createExoticTransformer_1 = require("./createExoticTransformer");
|
|
5
|
+
Object.defineProperty(exports, "createExoticTransformer", { enumerable: true, get: function () { return createExoticTransformer_1.createExoticTransformer; } });
|
|
6
|
+
var getCacheKey_1 = require("./getCacheKey");
|
|
7
|
+
Object.defineProperty(exports, "getCacheKey", { enumerable: true, get: function () { return getCacheKey_1.getCacheKey; } });
|
|
8
|
+
var createMultiRuleTransformer_1 = require("./createMultiRuleTransformer");
|
|
9
|
+
Object.defineProperty(exports, "loaders", { enumerable: true, get: function () { return createMultiRuleTransformer_1.loaders; } });
|
|
10
|
+
Object.defineProperty(exports, "createMultiRuleTransformer", { enumerable: true, get: function () { return createMultiRuleTransformer_1.createMultiRuleTransformer; } });
|
|
11
|
+
var createMatcher_1 = require("./createMatcher");
|
|
12
|
+
Object.defineProperty(exports, "createModuleMatcher", { enumerable: true, get: function () { return createMatcher_1.createModuleMatcher; } });
|
|
64
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transformer/index.ts"],"names":[],"mappings":";;;AAAA,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,2EAAmF;AAA1E,qHAAA,OAAO,OAAA;AAAE,wIAAA,0BAA0B,OAAA;AAC5C,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA"}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
function _createExoticTransformer() {
|
|
4
|
-
const data = require("./createExoticTransformer");
|
|
5
|
-
_createExoticTransformer = function () {
|
|
6
|
-
return data;
|
|
7
|
-
};
|
|
8
|
-
return data;
|
|
9
|
-
}
|
|
10
2
|
// Copyright 2021-present 650 Industries (Expo). All rights reserved.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const createExoticTransformer_1 = require("./createExoticTransformer");
|
|
5
|
+
module.exports = (0, createExoticTransformer_1.createExoticTransformer)({ nodeModulesPaths: ['node_modules'] });
|
|
15
6
|
//# sourceMappingURL=metro-expo-exotic-babel-transformer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metro-expo-exotic-babel-transformer.js","
|
|
1
|
+
{"version":3,"file":"metro-expo-exotic-babel-transformer.js","sourceRoot":"","sources":["../../src/transformer/metro-expo-exotic-babel-transformer.ts"],"names":[],"mappings":";AAAA,qEAAqE;;AAErE,uEAAoE;AAEpE,MAAM,CAAC,OAAO,GAAG,IAAA,iDAAuB,EAAC,EAAE,gBAAgB,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.importMetroConfig = importMetroConfig;
|
|
7
|
-
function _resolveFrom() {
|
|
8
|
-
const data = _interopRequireDefault(require("resolve-from"));
|
|
9
|
-
_resolveFrom = function () {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
2
|
// This package needs to be imported from within the project to
|
|
16
|
-
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.importMetroConfig = void 0;
|
|
8
|
+
const resolve_from_1 = __importDefault(require("resolve-from"));
|
|
17
9
|
// ensure that Metro can bundle the project's assets (see: `watchFolders`).
|
|
18
10
|
function importMetroConfig(projectRoot) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
const modulePath = resolve_from_1.default.silent(projectRoot, 'metro-config');
|
|
12
|
+
if (!modulePath) {
|
|
13
|
+
return require('metro-config');
|
|
14
|
+
}
|
|
15
|
+
return require(modulePath);
|
|
24
16
|
}
|
|
17
|
+
exports.importMetroConfig = importMetroConfig;
|
|
25
18
|
//# sourceMappingURL=metro-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metro-config.js","
|
|
1
|
+
{"version":3,"file":"metro-config.js","sourceRoot":"","sources":["../../src/traveling/metro-config.ts"],"names":[],"mappings":";AAAA,+DAA+D;;;;;;AAE/D,gEAAuC;AAEvC,2EAA2E;AAC3E,SAAgB,iBAAiB,CAAC,WAAmB;IAGnD,MAAM,UAAU,GAAG,sBAAW,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAEnE,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,OAAO,CAAC,cAAc,CAAC,CAAC;KAChC;IACD,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC;AATD,8CASC"}
|
package/build/utils/hash.js
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.hashString =
|
|
7
|
-
|
|
8
|
-
const data = _interopRequireDefault(require("crypto"));
|
|
9
|
-
_crypto = function () {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.hashString = void 0;
|
|
7
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
15
8
|
function hashString(str) {
|
|
16
|
-
|
|
9
|
+
return crypto_1.default.createHash('md5').update(str).digest('hex');
|
|
17
10
|
}
|
|
11
|
+
exports.hashString = hashString;
|
|
18
12
|
//# sourceMappingURL=hash.js.map
|
package/build/utils/hash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.js","
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/utils/hash.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,gBAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAFD,gCAEC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/metro-config",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.4",
|
|
4
4
|
"description": "A Metro config for running React Native projects with the Metro bundler",
|
|
5
5
|
"main": "build/ExpoMetroConfig.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "
|
|
7
|
+
"build": "expo-module tsc",
|
|
8
8
|
"clean": "expo-module clean",
|
|
9
9
|
"lint": "expo-module lint",
|
|
10
|
-
"prepare": "expo-module clean &&
|
|
10
|
+
"prepare": "expo-module clean && expo-module tsc",
|
|
11
11
|
"prepublishOnly": "expo-module prepublishOnly",
|
|
12
12
|
"test": "expo-module test",
|
|
13
13
|
"typecheck": "expo-module typecheck",
|
|
14
|
-
"watch": "expo-module
|
|
14
|
+
"watch": "expo-module tsc --watch --preserveWatchOutput"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"lightningcss": "~1.19.0",
|
|
54
54
|
"postcss": "~8.4.32",
|
|
55
55
|
"resolve-from": "^5.0.0",
|
|
56
|
-
"sucrase": "
|
|
56
|
+
"sucrase": "3.34.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@react-native/babel-preset": "*"
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "4f3dcf3e23eae997f884117fdd34ad734efad9fd"
|
|
70
70
|
}
|