diff --git a/build/lib/transpile-babel-paths.js b/build/lib/transpile-babel-paths.js index 889466961..4d1cd5709 100644 --- a/build/lib/transpile-babel-paths.js +++ b/build/lib/transpile-babel-paths.js @@ -1,10 +1,5 @@ -// This module exports a function that transpiles all files with a babel prefix -// into the appropriate location in the build output directory. - 'use strict' -module.exports = transpileBabelPaths - const babel = require('babel-core') const fs = require('fs') const glob = require('glob') @@ -21,7 +16,7 @@ const BABEL_PREFIXES = [ const PREFIX_LENGTH = Math.max.apply(null, BABEL_PREFIXES.map(prefix => prefix.length)) const BUFFER = Buffer(PREFIX_LENGTH) -function transpileBabelPaths () { +module.exports = function () { console.log('Transpiling Babel paths...'); for (let path of getPathsToTranspile()) { if (usesBabel(path)) { @@ -34,7 +29,10 @@ function getPathsToTranspile () { let paths = [] paths = paths.concat(glob.sync(path.join(CONFIG.electronAppPath, 'src', '**', '*.js'))) for (let packageName of Object.keys(CONFIG.appMetadata.packageDependencies)) { - paths = paths.concat(glob.sync(path.join(CONFIG.electronAppPath, 'node_modules', packageName, '**', '*.js'))) + paths = paths.concat(glob.sync( + path.join(CONFIG.electronAppPath, 'node_modules', packageName, '**', '*.js'), + {ignore: path.join(CONFIG.electronAppPath, 'node_modules', packageName, 'spec', '**', '*.js')} + )) } return paths } diff --git a/build/lib/transpile-coffee-script-paths.js b/build/lib/transpile-coffee-script-paths.js index 53407aa5a..6df2cd7f9 100644 --- a/build/lib/transpile-coffee-script-paths.js +++ b/build/lib/transpile-coffee-script-paths.js @@ -1,6 +1,3 @@ -// This module exports a function that transpiles all .coffee files into the -// appropriate location in the build output directory. - 'use strict' const coffee = require('coffee-script') @@ -10,8 +7,7 @@ const path = require('path') const CONFIG = require('../config') -module.exports = -function transpileCoffeeScriptPaths () { +module.exports = function () { console.log('Transpiling CoffeeScript paths...'); for (let path of getPathsToTranspile()) { transpileCoffeeScriptPath(path) @@ -24,7 +20,10 @@ function getPathsToTranspile () { paths = paths.concat(glob.sync(path.join(CONFIG.electronAppPath, 'spec', '*.coffee'))) paths = paths.concat(glob.sync(path.join(CONFIG.electronAppPath, 'exports', '**', '*.coffee'))) for (let packageName of Object.keys(CONFIG.appMetadata.packageDependencies)) { - paths = paths.concat(glob.sync(path.join(CONFIG.electronAppPath, 'node_modules', packageName, '**', '*.coffee'))) + paths = paths.concat(glob.sync( + path.join(CONFIG.electronAppPath, 'node_modules', packageName, '**', '*.coffee'), + {ignore: path.join(CONFIG.electronAppPath, 'node_modules', packageName, 'spec', '**', '*.coffee')} + )) } return paths }