Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function(cwd) {
registerBabel(cwd);
const config = getUserConfig({ cwd });
if (config.ssr) return false;
if (process.env.BIGFISH_COMPAT) {
if (config.appType !== 'console') return false;
if (config.deployMode === 'chair') return false;
}
const pkgFile = join(cwd, 'package.json');
const pkg = existsSync(pkgFile) ? JSON.parse(readFileSync(pkgFile, 'utf-8')) : {};
// disable if react is lower than 16
const reactVersion = getDep(pkg, 'react');
if (reactVersion) {
const reactPkgFile = join(cwd, 'node_modules', 'react', 'package.json');
const reactPkg = existsSync(reactPkgFile)
static getConfig(opts = {}) {
const { cwd, service } = opts;
return getUserConfig({
cwd,
defaultConfig: service.applyPlugins('modifyDefaultConfig', {
initialValue: {},
}),
});
}