Use the correct name in imports
This commit is contained in:
@@ -13,7 +13,7 @@ glob('src/**/*.js', {}, function(err, files) {
|
|||||||
const line = lines[i];
|
const line = lines[i];
|
||||||
const match = line.match(/export default _.*_([^;]*)_;$/);
|
const match = line.match(/export default _.*_([^;]*)_;$/);
|
||||||
if (match && match.length) {
|
if (match && match.length) {
|
||||||
var newName = match[1] + '.js';
|
const newName = match[1] + '.js';
|
||||||
if (newName != newName.toLowerCase()) {
|
if (newName != newName.toLowerCase()) {
|
||||||
fs.renameSync(filename, path.resolve(path.dirname(filename), newName));
|
fs.renameSync(filename, path.resolve(path.dirname(filename), newName));
|
||||||
++renamed;
|
++renamed;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ function resolve(fromName, toName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const back = new Array(fromLength - commonDepth).join('../') || './';
|
const back = new Array(fromLength - commonDepth).join('../') || './';
|
||||||
let relative = back + toParts.slice(commonDepth).join('/').toLowerCase();
|
let relative = back + toParts.slice(commonDepth).join('/');
|
||||||
if (relative.endsWith('/')) {
|
if (relative.endsWith('/')) {
|
||||||
relative += 'index';
|
relative += 'index';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user