Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
babelConfig.sourceMaps = true;
}
// Report a copy of the package's Babel configuration before loading plugins
report.packageProcessBabelConfig(pkg, cloneObject(babelConfig));
// Intercept presets and plugins to load them from here
babelConfig.plugins = config.babel.loadBabelPlugins(
babelConfig.presets || [],
babelConfig.plugins || []
);
babelConfig.presets = [];
// Determine files to process
const globs = [`${pkg.dir}/**/*.js`]
.concat(gl.negate(gl.prefix(`${pkg.dir}/`, ignore)))
.concat([`!${pkg.dir}/node_modules/**`]);
// Run babel through them
const filePaths = globby.sync(globs);
return processBabelFiles(filePaths, 0, pkg, babelConfig);
}
if (babelConfig.sourceMaps === undefined) {
babelConfig.sourceMaps = true;
}
// Report a copy of the package's Babel configuration before loading plugins
report.packageProcessBabelConfig(destPkg, clone(babelConfig));
// Intercept presets and plugins to load them from here
babelConfig.plugins = project.transform.getBabelPlugins(destPkg);
babelConfig.presets = [];
// Determine file globs
const globs = ['**/*.js', '!node_modules/**/*'];
if (destPkg.isRoot) {
globs.push(...gl.negate(project.transform.babelIgnores));
}
// Run babel through files
const prjRelPaths = findFiles(
project.dir.asNative,
gl.prefix(`${project.dir.asPosix}/${destPkg.dir.asPosix}/`, globs)
);
log.debug(
`Babelifying ${prjRelPaths.length} files in package '${destPkg.id}'...`
);
return runInChunks(
prjRelPaths,
project.misc.maxParallelFiles,
0,
`**/*`,
`!node_modules/**/*`,
])
);
const srcPkgRelPathsToCopy = srcPkg.isRoot
? srcPkgRelPaths
: runCopyPlugins(
srcPkg,
destPkg,
findFiles(
project.dir.join(srcPkg.dir).asNative,
gl.prefix(`${project.dir.asPosix}/${srcPkg.dir.asPosix}/`, [
`**/*`,
`!node_modules/**/*`,
...gl.negate(project.copy.getExclusions(srcPkg)),
])
)
);
report.packageCopy(srcPkg, srcPkgRelPaths, srcPkgRelPathsToCopy);
if (srcPkgRelPathsToCopy.length === 0) {
srcPkg.clean = true;
}
return Promise.all(
srcPkgRelPathsToCopy.map(srcPkgRelPath =>
copyFile(srcPkg, destPkg, srcPkgRelPath)
)
);
}