Minimize prod builds

pull/7789/head
Jeremy Tuloup 2 months ago
parent f0e7469483
commit b5ab71a6bd

@ -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"

@ -16,7 +16,7 @@ config[0] = merge(config[0], {
filename: '[name].[contenthash].js?v=[contenthash]',
},
optimization: {
minimize: false,
minimize: true,
},
plugins: [
new WPPlugin.JSONLicenseWebpackPlugin({

@ -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;

@ -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"

Loading…
Cancel
Save