|
@@ -30,6 +30,7 @@ build_aliases['app-dir'] = 'LabBuildApp.app_dir'
|
|
|
build_aliases['name'] = 'LabBuildApp.name'
|
|
|
build_aliases['version'] = 'LabBuildApp.version'
|
|
|
build_aliases['dev-build'] = 'LabBuildApp.dev_build'
|
|
|
+build_aliases['minimize'] = 'LabBuildApp.minimize'
|
|
|
build_aliases['debug-log-path'] = 'DebugLogFileMixin.debug_log_path'
|
|
|
|
|
|
build_flags = dict(flags)
|
|
@@ -64,11 +65,21 @@ class LabBuildApp(JupyterApp, DebugLogFileMixin):
|
|
|
dev_build = Bool(False, config=True,
|
|
|
help="Whether to build in dev mode (defaults to prod mode)")
|
|
|
|
|
|
+ minimize = Bool(True, config=True,
|
|
|
+ help="Whether to use a minifier during the Webpack build (defaults to True). Only affects production builds.")
|
|
|
+
|
|
|
pre_clean = Bool(False, config=True,
|
|
|
help="Whether to clean before building (defaults to False)")
|
|
|
|
|
|
def start(self):
|
|
|
- command = 'build:prod' if not self.dev_build else 'build'
|
|
|
+ if self.dev_build:
|
|
|
+ command = 'build'
|
|
|
+ else:
|
|
|
+ if self.minimize:
|
|
|
+ command = 'build:prod:minimize'
|
|
|
+ else:
|
|
|
+ command = 'build:prod'
|
|
|
+
|
|
|
app_dir = self.app_dir or get_app_dir()
|
|
|
self.log.info('JupyterLab %s', version)
|
|
|
with self.debug_logging():
|