fix(build): Defer require of parent node modules until they're fetched #2184

This commit is contained in:
Ben Gotow 2016-05-10 19:08:41 -07:00
parent b5ef44daaf
commit 134284ff9c
4 changed files with 7 additions and 7 deletions

View file

@ -184,6 +184,9 @@ module.exports = (grunt) ->
ext: '.js'
for folder in ['node_modules', 'internal_packages']
if not fs.existsSync(folder)
console.log("Ignoring #{folder}, which is missing.")
continue
for child in fs.readdirSync(folder) when child isnt '.bin'
directory = path.join(folder, child)
metadataPath = path.join(directory, 'package.json')

View file

@ -1,12 +1,10 @@
// Copied from https://github.com/babel/grunt-babel to ensure we always
// use the `babel-core` defined in our own package.json as opposed to the
// grunt-babel dependency's
var path = require('path');
var babel = require('babel-core');
module.exports = function (grunt) {
grunt.registerMultiTask('babel', 'Use next generation JavaScript, today', function () {
var path = require('path');
var babel = require('babel-core');
var options = this.options();
this.files.forEach(function (el) {

View file

@ -1,9 +1,9 @@
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', ->
ModuleCache = require '../../src/module-cache'
appDir = grunt.config.get('nylasGruntConfig.appDir')
{packageDependencies} = grunt.file.readJSON('package.json')

View file

@ -1,10 +1,9 @@
path = require 'path'
fs = require 'fs'
LessCache = require 'less-cache'
module.exports = (grunt) ->
grunt.registerMultiTask 'prebuild-less', 'Prebuild cached of compiled LESS files', ->
LessCache = require 'less-cache'
prebuiltConfigurations = [
['ui-light', 'ui-dark']
]