Skip to content

Commit

Permalink
Build script: move resolveModuleSource outside waterfall function
Browse files Browse the repository at this point in the history
  • Loading branch information
forabi committed Feb 13, 2016
1 parent 5197625 commit 11c98c8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions build-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@ const _ = require('async');
const babelrc = {
presets: ['es2015'],
plugins: ['add-module-exports'],
resolveModuleSource(source) {
return source
.replace('./util', './lib/util')
.replace('../util', './util');
},
};

glob('{index,*/**}.js', { cwd: 'src' }, (globErr, files) => {
_.each(files, (file, done) => {
_.waterfall([
(transformDone) => {
const options = Object.assign({
resolveModuleSource(source) {
return source
.replace('./util', './lib/util')
.replace('../util', './util');
},
}, babelrc);
babel.transformFile(`src/${file}`, options, transformDone);
babel.transformFile(`src/${file}`, babelrc, transformDone);
},
(result, writeDone) => {
const dest = file.replace(/^util/, 'lib/util');
Expand Down

0 comments on commit 11c98c8

Please sign in to comment.