mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 18:24:09 +03:00
a0d7bbdb92
It is now ~400k pretty printed and ~300k without
40 lines
1.2 KiB
CoffeeScript
40 lines
1.2 KiB
CoffeeScript
path = require 'path'
|
|
fs = require 'fs-plus'
|
|
ModuleCache = require '../../src/module-cache'
|
|
|
|
module.exports = (grunt) ->
|
|
grunt.registerTask 'generate-module-cache', 'Generate a module cache for all core modules and packages', ->
|
|
appDir = grunt.config.get('atom.appDir')
|
|
|
|
{packageDependencies} = grunt.file.readJSON('package.json')
|
|
|
|
for packageName, version of packageDependencies
|
|
ModuleCache.create(path.join(appDir, 'node_modules', packageName))
|
|
|
|
ModuleCache.create(appDir)
|
|
|
|
metadata = grunt.file.readJSON(path.join(appDir, 'package.json'))
|
|
|
|
metadata._atomModuleCache.folders.forEach (folder) ->
|
|
if '' in folder.paths
|
|
folder.paths = [
|
|
''
|
|
'exports'
|
|
'spec'
|
|
'src'
|
|
'src/browser'
|
|
'static'
|
|
'vendor'
|
|
]
|
|
|
|
# Reactionary does not have an explicit react dependency
|
|
metadata._atomModuleCache.folders.push
|
|
paths: [
|
|
'node_modules/reactionary-atom-fork/lib'
|
|
]
|
|
dependencies: {
|
|
'react-atom-fork': metadata.dependencies['react-atom-fork']
|
|
}
|
|
|
|
grunt.file.write(path.join(appDir, 'package.json'), JSON.stringify(metadata))
|