mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Stronger typing for transformers
Reviewed By: jeanlauliac Differential Revision: D5006679 fbshipit-source-id: 795c60db363fb53bc74697e4befe50995e9b97a7
This commit is contained in:
committed by
Facebook Github Bot
parent
3dfed2e865
commit
73fc439bc0
@@ -5,6 +5,8 @@
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -24,7 +26,7 @@ babelRegisterOnly([]);
|
||||
const transformer = require('../packager/transformer.js');
|
||||
|
||||
module.exports = {
|
||||
process(src, file) {
|
||||
process(src/*: string*/, file/*: string*/) {
|
||||
if (nodeFiles.test(file)) { // node specific transforms only
|
||||
return babel.transform(
|
||||
src,
|
||||
@@ -32,7 +34,12 @@ module.exports = {
|
||||
).code;
|
||||
}
|
||||
|
||||
return transformer.transform(src, file, {inlineRequires: true}).code;
|
||||
return transformer.transform(src, file, {
|
||||
dev: true,
|
||||
inlineRequires: true,
|
||||
platform: '',
|
||||
projectRoot: '',
|
||||
}).code;
|
||||
},
|
||||
|
||||
getCacheKey: createCacheKeyFunction([
|
||||
|
||||
Reference in New Issue
Block a user