Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function main() {
// Optimistically, we make the console look exactly like the output of our
// FriendlyErrorsPlugin during compilation, so the user has immediate feedback.
// clearConsole();
logger.start('Compiling...');
let razzle = {};
// Check for razzle.config.js file
if (fs.existsSync(paths.appRazzleConfig)) {
try {
razzle = require(paths.appRazzleConfig);
} catch (e) {
clearConsole();
logger.error('Invalid razzle.config.js file.', e);
process.exit(1);
}
}
// Delete assets.json to always have a manifest up to date
fs.removeSync(paths.appManifest);
const logger = require('razzle-dev-utils/logger');
const chokidar = require('chokidar');
const { choosePort } = require('react-dev-utils/WebpackDevServerUtils');
process.noDeprecation = true; // turns off that loadQuery clutter.
if (process.argv.includes('--inspect-brk')) {
process.env.INSPECT_BRK_ENABLED = true;
} else if (process.argv.includes('--inspect')) {
process.env.INSPECT_ENABLED = true;
}
// Optimistically, we make the console look exactly like the output of our
// FriendlyErrorsPlugin during compilation, so the user has immediate feedback.
// clearConsole();
logger.start('Compiling...');
let after = {};
// Check for after.config.js file
if (fs.existsSync(paths.appAfterConfig)) {
try {
after = require(paths.appAfterConfig);
} catch (e) {
clearConsole();
logger.error('Invalid after.config.js file.', e);
process.exit(1);
}
}
// Delete assets.json to always have a manifest up to date
fs.removeSync(paths.appManifest);
function main() {
logger.start('Compiling...');
const clientConfig = webpackConfig;
const serverConfig = Object.assign({},webpackConfig,{target:'node'});
const clientCompiler = compile(clientConfig);
const serverCompiler = compile(serverConfig);
clientCompiler.plugin('done', () => {
serverCompiler.watch(
{
quiet: true,
stats: 'none',
},
/* eslint-disable no-unused-vars */
stats => {}
);
});