Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function build(previousFileSizes) {
// Check if razzle.config.js exists
let razzle = {};
try {
razzle = require(paths.appRazzleConfig);
/* eslint-disable no-empty */
} catch (e) {}
/* eslint-enable */
if (razzle.clearConsole === false || !!razzle.host || !!razzle.port) {
logger.warn(`Specifying options \`port\`, \`host\`, and \`clearConsole\` in razzle.config.js has been deprecated.
Please use a .env file instead.
${razzle.host !== 'localhost' && `HOST=${razzle.host}`}
${razzle.port !== '3000' && `PORT=${razzle.port}`}
`);
}
// Create our production webpack configurations and pass in razzle options.
let clientConfig = createConfig('web', 'prod', razzle, webpack);
let serverConfig = createConfig('node', 'prod', razzle, webpack);
process.noDeprecation = true; // turns off that loadQuery clutter.
console.log('Creating an optimized production build...');
console.log('Compiling client...');
// First compile the client. We need it to properly output assets.json (asset
async function build(previousFileSizes) {
// Check if after.config.js exists
let after = {};
try {
after = require(paths.appAfterConfig);
/* eslint-disable no-empty */
} catch (e) {}
/* eslint-enable */
if (after.clearConsole === false || !!after.host || !!after.port) {
logger.warn(`Specifying options \`port\`, \`host\`, and \`clearConsole\` in after.config.js has been deprecated.
Please use a .env file instead.
${after.host !== 'localhost' && `HOST=${after.host}`}
${after.port !== '3000' && `PORT=${after.port}`}
`);
}
// Create our production webpack configurations and pass in after options.
let clientConfig = createConfig('web', 'prod', after);
let serverConfig = createConfig('node', 'prod', after);
// Check if after.config has a modify function. If it does, call it on the
// configs we just created.
if (after.modify) {
clientConfig = after.modify(
clientConfig,