Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const compilationConfig = {
env: 'production',
staticPath: resolveStaticPath(workDir, config.get('server')),
basePath: workDir,
outputPath: path.join(outputDir, 'static'),
sourceMaps: flags['source-maps'],
skipMinify: !flags.minify,
profile: flags.profile,
project: Object.assign({}, config.get('project'), overrides.project)
}
await tryInitializePluginConfigs({workDir, output, env: 'production'})
checkStudioDependencyVersions(workDir)
const envVars = webpackIntegration.getSanityEnvVars({env: 'production', basePath: workDir})
const envVarKeys = Object.keys(envVars)
if (envVarKeys.length > 0) {
output.print(
'\nIncluding the following environment variables as part of the JavaScript bundle:'
)
envVarKeys.forEach(key => output.print(`- ${key}`))
output.print('')
}
const compiler = getWebpackCompiler(compilationConfig)
const compile = promisify(compiler.run.bind(compiler))
let shouldDelete = true
if (outputDir !== defaultOutputDir && !unattendedMode) {
shouldDelete = await prompt.single({
type: 'confirm',