File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
packages/@angular/cli/commands Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { join } from 'path';
7
7
import { RenderUniversalTaskOptions } from '../tasks/render-universal' ;
8
8
9
9
const Command = require ( '../ember-cli/lib/models/command' ) ;
10
-
10
+ const SilentError = require ( 'silent-error' ) ;
11
11
12
12
const config = CliConfig . fromProject ( ) || CliConfig . fromGlobal ( ) ;
13
13
const buildConfigDefaults = config . getPaths ( 'defaults.build' , [
@@ -246,19 +246,25 @@ const BuildCommand = Command.extend({
246
246
ui : this . ui ,
247
247
} ) ;
248
248
249
-
250
- const buildPromise = buildTask . run ( commandOptions ) ;
251
-
252
-
253
249
const clientApp = getAppFromConfig ( commandOptions . app ) ;
254
250
255
251
const doAppShell = commandOptions . target === 'production' &&
256
252
( commandOptions . aot === undefined || commandOptions . aot === true ) &&
257
253
! commandOptions . skipAppShell ;
254
+
255
+ let serverApp : any = null ;
256
+ if ( clientApp . appShell && doAppShell ) {
257
+ serverApp = getAppFromConfig ( clientApp . appShell . app ) ;
258
+ if ( serverApp . platform !== 'server' ) {
259
+ throw new SilentError ( `Shell app's platform is not "server"` ) ;
260
+ }
261
+ }
262
+
263
+ const buildPromise = buildTask . run ( commandOptions ) ;
264
+
258
265
if ( ! clientApp . appShell || ! doAppShell ) {
259
266
return buildPromise ;
260
267
}
261
- const serverApp = getAppFromConfig ( clientApp . appShell . app ) ;
262
268
263
269
return buildPromise
264
270
. then ( ( ) => {
You can’t perform that action at this time.
0 commit comments