packages/app-clipper/popup/scripts/build.js
// Create the production build and print the deployment instructions.
Create the production build and print the deployment instructions.
Create the production build and print the deployment instructions .
function build(previousFileSizes) {
	if (process.env.NODE_PATH) {
		console.log(
			chalk.yellow(
				'Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.'
			)
		);
		console.log();
	}
	console.log('Creating an optimized production build...');
	const compiler = webpack(config);
	return new Promise((resolve, reject) => {
		compiler.run((err, stats) => {
			let messages;
			if (err) {
				if (!err.message) {
					return reject(err);
				}
				let errMessage = err.message;
				if (Object.prototype.hasOwnProperty.call(err, 'postcssNode')) {
					errMessage +=
            `\nCompileError: Begins at CSS selector ${
            	err['postcssNode'].selector}`;
				}
				messages = formatWebpackMessages({
					errors: [errMessage],
					warnings: [],
				});
			} else {
				messages = formatWebpackMessages(
					stats.toJson({ all: false, warnings: true, errors: true })
				);
			}
			if (messages.errors.length) {
				if (messages.errors.length > 1) {
					messages.errors.length = 1;
				}
				return reject(new Error(messages.errors.join('\n\n')));
			}
			if (
				process.env.CI &&
        (typeof process.env.CI !== 'string' ||
          process.env.CI.toLowerCase() !== 'false') &&
        messages.warnings.length
			) {
				console.log(
					chalk.yellow(
						'\nTreating warnings as errors because process.env.CI = true.\n' +
              'Most CI servers set it automatically.\n'
					)
				);
				return reject(new Error(messages.warnings.join('\n\n')));
			}
			return resolve({
				stats,
				previousFileSizes,
				warnings: messages.warnings,
			});
		});
	});
}
function build ( previousFileSizes ) { if ( process . env . NODE_PATH ) { console . log ( chalk . yellow ( 'Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.' ) ) ; console . log ( ) ; } console . log ( 'Creating an optimized production build...' ) ; const compiler = webpack ( config ) ; return new Promise ( ( resolve , reject ) => { compiler . run ( ( err , stats ) => { let messages ; if ( err ) { if ( ! err . message ) { return reject ( err ) ; } let errMessage = err . message ; if ( Object . prototype . hasOwnProperty . call ( err , 'postcssNode' ) ) { errMessage += ` \n ${ err [ 'postcssNode' ] . selector } ` ; } messages = formatWebpackMessages ( { errors : [ errMessage ] , warnings : [ ] , } ) ; } else { messages = formatWebpackMessages ( stats . toJson ( { all : false , warnings : true , errors : true } ) ) ; } if ( messages . errors . length ) { if ( messages . errors . length > 1 ) { messages . errors . length = 1 ; } return reject ( new Error ( messages . errors . join ( '\n\n' ) ) ) ; } if ( process . env . CI && ( typeof process . env . CI !== 'string' || process . env . CI . toLowerCase ( ) !== 'false' ) && messages . warnings . length ) { console . log ( chalk . yellow ( '\nTreating warnings as errors because process.env.CI = true.\n' + 'Most CI servers set it automatically.\n' ) ) ; return reject ( new Error ( messages . warnings . join ( '\n\n' ) ) ) ; } return resolve ( { stats , previousFileSizes , warnings : messages . warnings , } ) ; } ) ; } ) ; }
Create the production build and print the deployment instructions.
Create the production build and print the deployment instructions .
// We used to support resolving modules according to `NODE_PATH`. // This now has been deprecated in favor of jsconfig/tsconfig.json // This lets you use absolute paths in imports inside large monorepos: // Add additional information for postcss errors // Only keep the first error. Others are often indicative // of the same problem, but confuse the reader with noise.