GT2/GT2-iOS/node_modules/babel-plugin-module-resolver/lib/transformers/import.js

15 lines
442 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = transformImportCall;
function transformImportCall(t, nodePath, mapper, state, cwd) {
var source = nodePath.get('source');
if (source.type === 'StringLiteral') {
var modulePath = mapper(source.node.value, state.file.opts.filename, state.opts, cwd);
if (modulePath) {
source.replaceWith(t.stringLiteral(modulePath));
}
}
}