MCPcopy Index your code
hub / github.com/devspace-sh/devspace / build

Function build

ui/scripts/build.js:103–142  ·  view source on GitHub ↗
(previousFileSizes)

Source from the content-addressed store, hash-verified

101
102// Create the production build and print the deployment instructions.
103function build(previousFileSizes) {
104 console.log('Creating an optimized production build...');
105
106 let compiler = webpack(config);
107 return new Promise((resolve, reject) => {
108 compiler.run((err, stats) => {
109 if (err) {
110 return reject(err);
111 }
112 const messages = formatWebpackMessages(stats.toJson({}, true));
113 if (messages.errors.length) {
114 // Only keep the first error. Others are often indicative
115 // of the same problem, but confuse the reader with noise.
116 if (messages.errors.length > 1) {
117 messages.errors.length = 1;
118 }
119 return reject(new Error(messages.errors.join('\n\n')));
120 }
121 if (
122 process.env.CI &&
123 (typeof process.env.CI !== 'string' ||
124 process.env.CI.toLowerCase() !== 'false') &&
125 messages.warnings.length
126 ) {
127 console.log(
128 chalk.yellow(
129 '\nTreating warnings as errors because process.env.CI = true.\n' +
130 'Most CI servers set it automatically.\n'
131 )
132 );
133 return reject(new Error(messages.warnings.join('\n\n')));
134 }
135 return resolve({
136 stats,
137 previousFileSizes,
138 warnings: messages.warnings,
139 });
140 });
141 });
142}
143
144function copyPublicFolder() {
145 fs.copySync(paths.appPublic, paths.appBuild, {

Callers 1

build.jsFile · 0.85

Calls 2

resolveFunction · 0.85
runMethod · 0.80

Tested by

no test coverage detected