Rename before running transform
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
"changecase-src": "node tasks/filename-case-from-module.js",
|
||||
"transform-examples": "jscodeshift --transform transforms/module.js examples",
|
||||
"transform-test": "jscodeshift --transform transforms/module.js test",
|
||||
"transform": "npm run transform-src && npm run changecase-src && npm run transform-examples && npm run transform-test && npm run lint -- --fix"
|
||||
"transform": "npm run changecase-src && npm run transform-src && npm run transform-examples && npm run transform-test && npm run lint -- --fix"
|
||||
},
|
||||
"main": "dist/ol.js",
|
||||
"repository": {
|
||||
|
||||
@@ -11,7 +11,7 @@ glob('src/**/*.js', {}, function(err, files) {
|
||||
const lines = contents.split('\n');
|
||||
for (let i = lines.length - 1; i >= 0; --i) {
|
||||
const line = lines[i];
|
||||
const match = line.match(/export default _.*_([^;]*)_;$/);
|
||||
const match = line.match(/goog\.provide\('.*\.([^']*)'\);$/);
|
||||
if (match && match.length) {
|
||||
const newName = match[1] + '.js';
|
||||
if (newName != newName.toLowerCase()) {
|
||||
|
||||
Reference in New Issue
Block a user