/
githubmirror
/
atom
Обзор
Документация
Войти
/
githubmirror
/
atom
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.55.0
script/lib/generate-module-cache.js
38 строк
1 KB
Rafael Oleza
Reformat all JS files using prettier
31 май 2019, 19:33
31 май 2019, 19:33
7f3f040
Код
Авторство
О чём код?
'use strict'; const fs = require('fs'); const path = require('path'); const ModuleCache = require('../../src/module-cache'); const CONFIG = require('../config'); module.exports = function() { console.log(`Generating module cache for ${CONFIG.intermediateAppPath}`); for (let packageName of Object.keys(CONFIG.appMetadata.packageDependencies)) { ModuleCache.create( path.join(CONFIG.intermediateAppPath, 'node_modules', packageName) ); } ModuleCache.create(CONFIG.intermediateAppPath); const newMetadata = JSON.parse( fs.readFileSync(path.join(CONFIG.intermediateAppPath, 'package.json')) ); for (let folder of newMetadata._atomModuleCache.folders) { if (folder.paths.indexOf('') !== -1) { folder.paths = [ '', 'exports', 'spec', 'src', 'src/main-process', 'static', 'vendor' ]; } } CONFIG.appMetadata = newMetadata; fs.writeFileSync( path.join(CONFIG.intermediateAppPath, 'package.json'), JSON.stringify(CONFIG.appMetadata) ); };