Skip to content

Commit 1f3b212

Browse files
committed
match lab config
1 parent 62ee137 commit 1f3b212

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
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:minimize": "rspack --config ./rspack.prod.minimize.config.js",
89
"build:prod:release": "rspack --config ./rspack.prod.release.config.js",
910
"clean": "rimraf build && jlpm run clean:static",
1011
"clean:static": "rimraf -g \"../notebook/static/!(favicons)\"",

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: true,
19+
minimize: false,
2020
},
2121
plugins: [
2222
new WPPlugin.JSONLicenseWebpackPlugin({

app/rspack.prod.minimize.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 WPPlugin = require('@jupyterlab/builder').WPPlugin;
8+
const config = require('./rspack.config');
9+
10+
config[0] = merge(config[0], {
11+
mode: 'production',
12+
devtool: 'source-map',
13+
output: {
14+
// Add version argument when in production so the Jupyter server
15+
// allows caching of files (i.e., does not set the CacheControl header to no-cache to prevent caching static files)
16+
filename: '[name].[contenthash].js?v=[contenthash]',
17+
},
18+
optimization: {
19+
minimize: true,
20+
},
21+
plugins: [
22+
new WPPlugin.JSONLicenseWebpackPlugin({
23+
excludedPackageTest: (packageName) =>
24+
packageName === '@jupyter-notebook/app',
25+
}),
26+
],
27+
});
28+
29+
module.exports = config;

app/rspack.prod.release.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
const merge = require('webpack-merge').default;
7-
const config = require('./rspack.prod.config');
7+
const config = require('./rspack.prod.minimize.config');
88

99
config[0] = merge(config[0], {
1010
// Turn off source maps

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"build": "lerna run build",
2424
"build:lib": "lerna run build:lib",
2525
"build:prod": "lerna run build:prod --skip-nx-cache",
26+
"build:prod:minimize": "lerna run build:prod --skip-nx-cache --ignore @jupyter-notebook/app && jlpm workspace @jupyter-notebook/app build:prod:minimize",
2627
"build:prod:release": "lerna run build:prod --skip-nx-cache --ignore @jupyter-notebook/app && jlpm workspace @jupyter-notebook/app build:prod:release",
2728
"build:test": "lerna run build:test",
2829
"build:utils": "cd buildutils && npm run build",

0 commit comments

Comments
 (0)