react-native/jestSupport/scriptPreprocess.js
Christopher Chedeau 9bebc7e519 Updates from Wed Feb 25
- [react-packager] Fix lint errors | Amjad Masad
- [react-packager] fix a typo s/pacakge/package | Chengyin Liu
- [react-packager] Fix jest tests | Amjad Masad
- [Image] Really improve the quality of mis-sized images w/trilinear filtering | James Ide
2015-03-02 10:42:31 -08:00

26 lines
560 B
JavaScript

'use strict';
var transformer = require('../packager/transformer.js');
function transformSource(src) {
return transformer.transform(null, src).code;
}
module.exports = {
transformSource: transformSource,
process: function(src, fileName) {
if (fileName.match(/node_modules/)) {
return src;
}
try {
return transformSource(src);
} catch(e) {
throw new Error('\nError transforming file:\n js/' +
(fileName.split('/js/')[1] || fileName) + ':' + e.lineNumber + ': \'' +
e.message + '\'\n');
}
}
};