mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
🎨
This commit is contained in:
parent
6903e941d9
commit
ee60a2daaa
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user