diff --git a/app/package.json b/app/package.json index 99265ba1b9..10a8af984b 100644 --- a/app/package.json +++ b/app/package.json @@ -5,6 +5,7 @@ "scripts": { "build": "rspack", "build:prod": "rspack --config ./rspack.prod.config.js", + "build:prod:release": "rspack --config ./rspack.prod.release.config.js", "clean": "rimraf build && jlpm run clean:static", "clean:static": "rimraf -g \"../notebook/static/!(favicons)\"", "watch": "rspack --watch --config rspack.config.js" diff --git a/app/rspack.prod.config.js b/app/rspack.prod.config.js index a010b88b1a..5e92669a21 100644 --- a/app/rspack.prod.config.js +++ b/app/rspack.prod.config.js @@ -16,7 +16,7 @@ config[0] = merge(config[0], { filename: '[name].[contenthash].js?v=[contenthash]', }, optimization: { - minimize: false, + minimize: true, }, plugins: [ new WPPlugin.JSONLicenseWebpackPlugin({ diff --git a/app/rspack.prod.release.config.js b/app/rspack.prod.release.config.js new file mode 100644 index 0000000000..fcba47391e --- /dev/null +++ b/app/rspack.prod.release.config.js @@ -0,0 +1,14 @@ +/* + * Copyright (c) Jupyter Development Team. + * Distributed under the terms of the Modified BSD License. + */ + +const merge = require('webpack-merge').default; +const config = require('./rspack.prod.config'); + +config[0] = merge(config[0], { + // Turn off source maps + devtool: false, +}); + +module.exports = config; diff --git a/package.json b/package.json index 0e06f25ade..c186791c4d 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "build": "lerna run build", "build:lib": "lerna run build:lib", "build:prod": "lerna run build:prod --skip-nx-cache", + "build:prod:release": "lerna run build:prod --skip-nx-cache --ignore @jupyter-notebook/app && jlpm workspace @jupyter-notebook/app build:prod:release", "build:test": "lerna run build:test", "build:utils": "cd buildutils && npm run build", "clean": "lerna run clean", diff --git a/pyproject.toml b/pyproject.toml index 1fe6f082ac..4d18bb080e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -166,7 +166,7 @@ ensured-targets = [ install-pre-commit-hook = true [tool.hatch.build.hooks.jupyter-builder.build-kwargs] -build_cmd = "build:prod" +build_cmd = "build:prod:release" source_dir = "packages" build_dir = "notebook/static" npm = ["jlpm"] @@ -189,7 +189,7 @@ before-bump-version = [ ] before-build-npm = [ "jlpm clean", - "jlpm build:prod" + "jlpm build:prod:release" ] before-build-python = [ "jlpm clean"