MCPcopy Create free account
hub / github.com/ember-cli/ember-cli / run

Function run

lib/commands/build.js:40–72  ·  view source on GitHub ↗
(commandOptions)

Source from the content-addressed store, hash-verified

38 },
39
40 async run(commandOptions) {
41 if (this.isViteProject && !process.env.EMBROIDER_PREBUILD) {
42 // --watch is used during Embroider prebuild but should never be used directly so we only throw in this case if
43 // EMBROIDER_PREBUILD has been set
44 if (commandOptions.watch) {
45 return Promise.reject(
46 new SilentError(
47 'The `--watch` option to `ember build` is not supported in Vite-based projects. Please use `vite dev` instead.'
48 )
49 );
50 }
51
52 if (commandOptions.watcher) {
53 return Promise.reject(
54 new SilentError(
55 'The `--watcher` option to `ember build` is not supported in Vite-based projects. Please use `vite dev` instead.'
56 )
57 );
58 }
59 }
60
61 await Win.checkIfSymlinksNeedToBeEnabled(this.ui);
62
63 let buildTaskName = commandOptions.watch ? 'BuildWatch' : 'Build';
64 await this.runTask(buildTaskName, commandOptions);
65
66 let isProduction = commandOptions.environment === 'production' || process.env.EMBER_ENV === 'production';
67 if (!commandOptions.suppressSizes && isProduction) {
68 return this.runTask('ShowAssetSizes', {
69 outputPath: commandOptions.outputPath,
70 });
71 }
72 },
73});

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected