Skip to content

Commit

Permalink
fix(config): comment out unused codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl committed Jan 31, 2020
1 parent e0895da commit dff1332
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/config/config-set.ts
Expand Up @@ -349,23 +349,23 @@ export class ConfigSet {
}
}

private static loadConfig(base: BabelConfig): BabelConfig {
// loadPartialConfig is from babel 7+, and OptionManager is backward compatible but deprecated 6 API
const { OptionManager, loadPartialConfig, version } = importer.babelCore(ImportReasons.BabelJest)
// cwd is only supported from babel >= 7
if (version && semver.satisfies(version, '>=6 <7')) {
delete base.cwd
}
// call babel to load options
if (typeof loadPartialConfig === 'function') {
const partialConfig = loadPartialConfig(base)
if (partialConfig) {
return partialConfig.options as BabelConfig
}
}

return new OptionManager().init(base) as BabelConfig
}
// private static loadConfig(base: BabelConfig): BabelConfig {
// // loadPartialConfig is from babel 7+, and OptionManager is backward compatible but deprecated 6 API
// const { OptionManager, loadPartialConfig, version } = importer.babelCore(ImportReasons.BabelJest)
// // cwd is only supported from babel >= 7
// if (version && semver.satisfies(version, '>=6 <7')) {
// delete base.cwd
// }
// // call babel to load options
// if (typeof loadPartialConfig === 'function') {
// const partialConfig = loadPartialConfig(base)
// if (partialConfig) {
// return partialConfig.options as BabelConfig
// }
// }
//
// return new OptionManager().init(base) as BabelConfig
// }

@Memoize()
get babel(): BabelConfig | undefined {
Expand Down

0 comments on commit dff1332

Please sign in to comment.