[dev] Allow for building production assets (#67230)

* Also allows passing through watch

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
Tyler Smalley 2020-05-21 19:30:35 -07:00 committed by GitHub
parent 875d698128
commit 5b6ad3fe4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -33,9 +33,10 @@ import { LegacyConfig } from '../../core/server/legacy';
export function runKbnOptimizer(opts: Record<string, any>, config: LegacyConfig) {
const optimizerConfig = OptimizerConfig.create({
repoRoot: REPO_ROOT,
watch: true,
watch: !!opts.watch,
includeCoreBundle: true,
cache: !!opts.cache,
dist: !!opts.dist,
oss: !!opts.oss,
examples: !!opts.runExamples,
pluginPaths: config.get('plugins.paths'),

View file

@ -213,6 +213,7 @@ export default function(program) {
.option('--dev', 'Run the server with development mode defaults')
.option('--open', 'Open a browser window to the base url after the server is started')
.option('--ssl', 'Run the dev server using HTTPS')
.option('--dist', 'Use production assets from kbn/optimizer')
.option(
'--no-base-path',
"Don't put a proxy in front of the dev server, which adds a random basePath"
@ -255,6 +256,7 @@ export default function(program) {
optimize: !!opts.optimize,
oss: !!opts.oss,
cache: !!opts.cache,
dist: !!opts.dist,
},
features: {
isClusterModeSupported: CAN_CLUSTER,