Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
aliases = [],
sourceMap = false,
postcss: postcssOpts,
prod = process.env.NODE_ENV === PRODUCTION,
} = {}) => {
const pkgsPath = path.resolve(
typeof monorepo === 'string' ? monorepo : 'packages',
)
if (monorepo !== false) {
monorepo = fs.existsSync(pkgsPath)
}
const pkgs = monorepo ? fs.readdirSync(pkgsPath) : ['']
const globals = getGlobals({
globals: umdGlobals,
})
const configs = flatMap(pkgs, pkg => {
const pkgPath = path.resolve(monorepo ? pkgsPath : '', pkg)
const srcPath = path.resolve(pkgPath, 'src')
let pkgInput = input
let pkgOutputDir = outputDir
if (!fs.existsSync(srcPath) && pkgInput == null) {
pkgInput = 'index'
}
pkgInput = tryExtensions(path.resolve(pkgPath, pkgInput || 'src/index'))