Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function resolveRootDir(cwd) {
// Resolve project root directory
try {
return (
resolveProjectRoot({
basePath: cwd,
sync: true
}) || cwd
)
} catch (err) {
console.warn(
chalk.red(['Error occured trying to resolve project root:', err.message].join('\n'))
)
process.exit(1)
}
return false
}
process.exit(1)
} else {
throw err
}
}
updateNotifier({pkg}).notify({defer: false})
const devMode = hasDevMode()
const args = parseArguments()
const isInit = args.groupOrCommand === 'init'
// Resolve project root directory
let workDir = cwd
try {
workDir = resolveProjectRoot({
basePath: cwd,
sync: true
}) || cwd
} catch (err) {
console.warn(chalk.red([
'Error occured trying to resolve project root:',
err.message
].join('\n')))
process.exit(1)
}
if (devMode) {
require('source-map-support').install()
process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled Rejection:', reason.stack)
const resolveProjectRoot = require('@sanity/resolver').resolveProjectRoot
const webpackIntegration = require('@sanity/webpack-integration/v3')
module.exports = {
plugins: webpackIntegration.getPostcssPlugins({
basePath: resolveProjectRoot({sync: true}),
cssnext: {
features: {
customProperties: true
}
}
})
}