mirror of
https://github.com/status-im/metro.git
synced 2025-01-27 03:14:49 +00:00
Back out stack D7846453..D7858549
Differential Revision: D7888839 fbshipit-source-id: 872969ab2f92abae0a8bb5472779a46ffe85e2a7
This commit is contained in:
parent
2af0396ffe
commit
5f6ada9e8b
@ -30,7 +30,7 @@ describe('code transformation worker:', () => {
|
||||
'arbitrary/file.js',
|
||||
`local/file.js`,
|
||||
'someReallyArbitrary(code)',
|
||||
require.resolve('metro/src/transformer.js'),
|
||||
path.join(__dirname, '../../../transformer.js'),
|
||||
true,
|
||||
{
|
||||
dev: true,
|
||||
@ -59,7 +59,7 @@ describe('code transformation worker:', () => {
|
||||
'arbitrary/file.js',
|
||||
`local/file.js`,
|
||||
'arbitrary(code)',
|
||||
require.resolve('metro/src/transformer.js'),
|
||||
path.join(__dirname, '../../../transformer.js'),
|
||||
false,
|
||||
{
|
||||
dev: true,
|
||||
@ -94,7 +94,7 @@ describe('code transformation worker:', () => {
|
||||
'const b = require("b");',
|
||||
'import c from "./c";',
|
||||
].join('\n'),
|
||||
require.resolve('metro/src/transformer.js'),
|
||||
path.join(__dirname, '../../../transformer.js'),
|
||||
false,
|
||||
{
|
||||
dev: true,
|
||||
|
@ -16,6 +16,7 @@ jest.mock('../../../package.json', () => ({
|
||||
}));
|
||||
|
||||
const getTransformCacheKeyFn = require('../getTransformCacheKeyFn');
|
||||
const path = require('path');
|
||||
|
||||
describe('getTransformCacheKeyFn', () => {
|
||||
it('Should return always the same key for the same params', async () => {
|
||||
@ -25,7 +26,10 @@ describe('getTransformCacheKeyFn', () => {
|
||||
cacheVersion: '1.0',
|
||||
dynamicDepsInPackages: 'arbitrary',
|
||||
projectRoots: [__dirname],
|
||||
transformModulePath: require.resolve('metro/src/defaultTransform.js'),
|
||||
transformModulePath: path.resolve(
|
||||
__dirname,
|
||||
'../../defaultTransform.js',
|
||||
),
|
||||
})(),
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
@ -36,7 +40,7 @@ describe('getTransformCacheKeyFn', () => {
|
||||
cacheVersion: '1.0',
|
||||
dynamicDepsInPackages: 'arbitrary',
|
||||
projectRoots: [__dirname],
|
||||
transformModulePath: require.resolve('metro/src/defaultTransform.js'),
|
||||
transformModulePath: path.resolve(__dirname, '../../defaultTransform.js'),
|
||||
};
|
||||
|
||||
const changedParams = [
|
||||
@ -50,7 +54,10 @@ describe('getTransformCacheKeyFn', () => {
|
||||
},
|
||||
{
|
||||
...baseParams,
|
||||
transformModulePath: require.resolve('metro/src/transformer.js'),
|
||||
transformModulePath: path.resolve(
|
||||
__dirname,
|
||||
'../../../src/transformer.js',
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -29,7 +29,7 @@ function getPreludeCode({
|
||||
}
|
||||
|
||||
function formatExtraVars(extraVars) {
|
||||
const assignments = [];
|
||||
let assignments = [];
|
||||
for (const key in extraVars) {
|
||||
assignments.push(`${key}=${JSON.stringify(extraVars[key])}`);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ const getBabelRC = (function() {
|
||||
// use the Babel config provided with react-native.
|
||||
if (!projectBabelRCPath || !fs.existsSync(projectBabelRCPath)) {
|
||||
babelRC = json5.parse(
|
||||
fs.readFileSync(require.resolve('metro/rn-babelrc.json')),
|
||||
fs.readFileSync(path.resolve(__dirname, '..', 'rn-babelrc.json')),
|
||||
);
|
||||
|
||||
// Require the babel-preset's listed in the default babel config
|
||||
|
Loading…
x
Reference in New Issue
Block a user