/
githubmirror
/
atom
Обзор
Документация
Войти
/
githubmirror
/
atom
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
script/lib/transpile-babel-paths.js
51 строка
1 KB
Rafael Oleza
Reformat all JS files using prettier
31 май 2019, 19:33
31 май 2019, 19:33
7f3f040
Код
Авторство
О чём код?
'use strict'; const CompileCache = require('../../src/compile-cache'); const fs = require('fs'); const glob = require('glob'); const path = require('path'); const CONFIG = require('../config'); module.exports = function() { console.log(`Transpiling Babel paths in ${CONFIG.intermediateAppPath}`); for (let path of getPathsToTranspile()) { transpileBabelPath(path); } }; function getPathsToTranspile() { let paths = []; for (let packageName of Object.keys(CONFIG.appMetadata.packageDependencies)) { paths = paths.concat( glob.sync( path.join( CONFIG.intermediateAppPath, 'node_modules', packageName, '**', '*.js' ), { ignore: path.join( CONFIG.intermediateAppPath, 'node_modules', packageName, 'spec', '**', '*.js' ), nodir: true } ) ); } return paths; } function transpileBabelPath(path) { fs.writeFileSync( path, CompileCache.addPathToCache(path, CONFIG.atomHomeDirPath) ); }