Issue 1:
After upgrading to babel 7, the command to transpile a directory, that worked well in the same project with Babel 6 is failing with a Maximum call stack size exceeded after transpiling 369 files.

The command executed is:

babel --copy-files --ignore '**/__tests__/*.js,node_modules' --out-dir ./functions ./modules

When executed on a subset of the the folder, it works well. It seems to be an issue with the number of files being transpiled.

Stack trace

(The stack trace changes with the number of files being transpilled).

RangeError: Maximum call stack size exceeded
at normalizeStringPosix (path.js:78:30)
at Object.normalize (path.js:1193:12)
at Object.join (path.js:1228:18)
at getDest (<project>/node_modules/@babel/cli/lib/babel/dir.js:57:26)
at <project>/node_modules/@babel/cli/lib/babel/dir.js:70:20
at write (<project>/node_modules/@babel/cli/lib/babel/dir.js:30:14)
at handleFile (<project>/node_modules/@babel/cli/lib/babel/dir.js:66:5)
at sequentialHandleFile (<project>/node_modules/@babel/cli/lib/babel/dir.js:89:5)
at <project>/node_modules/@babel/cli/lib/babel/dir.js:94:9
at <project>/node_modules/@babel/cli/lib/babel/dir.js:75:14

Babel Configuration

{
"presets": [
["@babel/env", {
"targets": {
"node": "6.11.5"
}
}],
"@babel/flow",
"@babel/react"
],
"plugins": [
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
"transform-decorators",
[ "module-resolver", {
"alias": {
"@gitbook": "./modules",
"aphrodite": "aphrodite/no-important"
},
"cwd": "babelrc"
}]
],
"ignore": [
"modules/node_modules/**/*",
"modules/styleguide/icons/*.js"
]
}

Issue 2:
Babel/Babylon Configuration (.babelrc, package.json, cli command)

.babelrc

{
"presets": [
["@babel/env", {
"targets": { "node": "6.11.5" }
}]
],
"plugins": ["@babel/plugin-proposal-object-rest-spread"]
}

CLI Command

babel 'functions/src' --out-dir 'functions/bundle' --copy-files --ignore 'functions/src/node_modules'

Expected Behavior

After executing this command, resulting files were correctly copied at functions/bundle folder using beta.37

Current Behavior

With beta.38 and beta.39, following error arises after processing last file

RangeError: Maximum call stack size exceeded
at /Users/karlas/myapp/node_modules/@babel/cli/lib/babel/dir.js:71:56
at write (/Users/karlas/myapp/node_modules/@babel/cli/lib/babel/dir.js:30:14)
at handleFile (/Users/karlas/myapp/node_modules/@babel/cli/lib/babel/dir.js:66:5)
at sequentialHandleFile (/Users/karlas/myapp/node_modules/@babel/cli/lib/babel/dir.js:89:5)
at /Users/karlas/myapp/node_modules/@babel/cli/lib/babel/dir.js:94:9
at /Users/karlas/myapp/node_modules/@babel/cli/lib/babel/dir.js:75:14
at write (/Users/karlas/myapp/node_modules/@babel/cli/lib/babel/dir.js:30:14)
at handleFile (/Users/karlas/myapp/node_modules/@babel/cli/lib/babel/dir.js:66:5)
at sequentialHandleFile (/Users/karlas/myapp/node_modules/@babel/cli/lib/babel/dir.js:89:5)
at /Users/karlas/myapp/node_modules/@babel/cli/lib/babel/dir.js:94:9

Possible Solution

Check 26e4911#diff-f93fbf6dce06b5cbf6cc65f5f7dac101

This is the last commit where this dir.js file was modified. Tags are beta.38 and beta.39 (the affected versions)

Context

Just transpiling about 20 files to be used on Firebase Functions

Your Environment

software
version(s)

Babel
7.0.0-beta.39

node
8.9.3

npm
5.5.1

yarn
1.3.2

Operating System
macOS High Sierra