8db77f2405
simplify: - use same html file for dart and JS - build benchmarks automatically when doing `gulp build` - centralize configuration modularize: - move all build tasks into separate node.js modules under `tools/build`. changes: - the `build` folder is now the `dist` folder Closes #284
17 lines
540 B
JavaScript
17 lines
540 B
JavaScript
function file2moduleName(filePath) {
|
|
return filePath.replace(/\\/g, '/')
|
|
// module name should be relative to `modules` and `tools` folder
|
|
.replace(/.*\/modules\//, '')
|
|
.replace(/.*\/tools\//, '')
|
|
// module name should not include `src`, `test`, `lib`
|
|
.replace(/\/src\//, '/')
|
|
.replace(/\/web\//, '/')
|
|
.replace(/\/perf_tmp\//, '/')
|
|
.replace(/\/lib\//, '/')
|
|
// module name should not have a suffix
|
|
.replace(/\.\w*$/, '');
|
|
}
|
|
if (typeof module !== 'undefined') {
|
|
module.exports = file2moduleName;
|
|
}
|