Skip to content

Commit 9aa0c87

Browse files
committed
Minimize prod builds
1 parent bc204fe commit 9aa0c87

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"build": "rspack",
77
"build:prod": "rspack --config ./rspack.prod.config.js",
8+
"build:prod:release": "rspack --config ./rspack.prod.release.config.js",
89
"clean": "rimraf build && jlpm run clean:static",
910
"clean:static": "rimraf -g \"../notebook/static/!(favicons)\"",
1011
"watch": "rspack --watch --config rspack.config.js"

app/rspack.prod.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ config[0] = merge(config[0], {
1616
filename: '[name].[contenthash].js?v=[contenthash]',
1717
},
1818
optimization: {
19-
minimize: false,
19+
minimize: true,
2020
},
2121
plugins: [
2222
new WPPlugin.JSONLicenseWebpackPlugin({

app/rspack.prod.release.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) Jupyter Development Team.
3+
* Distributed under the terms of the Modified BSD License.
4+
*/
5+
6+
const merge = require('webpack-merge').default;
7+
const config = require('./rspack.prod.config');
8+
9+
config[0] = merge(config[0], {
10+
// Turn off source maps
11+
devtool: false,
12+
});
13+
14+
module.exports = config;

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ ensured-targets = [
165165
install-pre-commit-hook = true
166166

167167
[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
168-
build_cmd = "build:prod"
168+
build_cmd = "build:prod:release"
169169
source_dir = "packages"
170170
build_dir = "notebook/static"
171171
npm = ["jlpm"]
@@ -188,7 +188,7 @@ before-bump-version = [
188188
]
189189
before-build-npm = [
190190
"jlpm clean",
191-
"jlpm build:prod"
191+
"jlpm build:prod:release"
192192
]
193193
before-build-python = [
194194
"jlpm clean"

0 commit comments

Comments
 (0)