Adding hotfixes for packages
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
26
jsx-html/babel-remove-ext.js
Normal file
26
jsx-html/babel-remove-ext.js
Normal file
@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
var regExp = /\.(ts|tsx|js|jsx)$/i;
|
||||
|
||||
module.exports = function () {
|
||||
return {
|
||||
visitor: {
|
||||
ImportDeclaration: function ImportDeclaration(path) {
|
||||
var source = path.node.source;
|
||||
if (!source.value.match(regExp)) {
|
||||
return;
|
||||
}
|
||||
source.value = source.value.replace(regExp, '');
|
||||
},
|
||||
ExportDeclaration: function ExportDeclaration(path) {
|
||||
var source = path.node.source;
|
||||
if (source) {
|
||||
if (!source.value.match(regExp)) {
|
||||
return;
|
||||
}
|
||||
source.value = source.value.replace(regExp, '');
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user