Skip to content

Commit d571476

Browse files
committed
chore: support faster release
1 parent d6ded4d commit d571476

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

.github/workflows/release-canary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
options:
1515
- release
1616
- release-debug
17-
- dev
17+
- release-dev
1818
description: "release-debug means release with debug info for profile"
1919

2020
permissions:

Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ rspack_plugin_merge = { version = "0.2.0", path = "crates/rsp
170170
rspack_plugin_merge_duplicate_chunks = { version = "0.2.0", path = "crates/rspack_plugin_merge_duplicate_chunks" }
171171
rspack_plugin_mf = { version = "0.2.0", path = "crates/rspack_plugin_mf" }
172172
rspack_plugin_mini_css_extract = { version = "0.2.0", path = "crates/rspack_plugin_mini_css_extract" }
173+
rspack_plugin_next_flight_client_entry = { path = "crates/rspack_plugin_next_flight_client_entry" }
173174
rspack_plugin_no_emit_on_errors = { version = "0.2.0", path = "crates/rspack_plugin_no_emit_on_errors" }
174175
rspack_plugin_progress = { version = "0.2.0", path = "crates/rspack_plugin_progress" }
175176
rspack_plugin_real_content_hash = { version = "0.2.0", path = "crates/rspack_plugin_real_content_hash" }
@@ -191,7 +192,6 @@ rspack_swc_plugin_import = { version = "0.2.0", path = "crates/swc
191192
rspack_testing = { version = "0.2.0", path = "crates/rspack_testing" }
192193
rspack_tracing = { version = "0.2.0", path = "crates/rspack_tracing" }
193194
rspack_util = { version = "0.2.0", path = "crates/rspack_util" }
194-
rspack_plugin_next_flight_client_entry = { path = "crates/rspack_plugin_next_flight_client_entry" }
195195

196196

197197
[workspace.metadata.release]
@@ -202,6 +202,7 @@ debug = 2 # debug build will cause runtime panic if codegen-unints
202202
incremental = true
203203
panic = "abort"
204204

205+
205206
[profile.release]
206207
codegen-units = 1
207208
debug = false
@@ -223,6 +224,12 @@ inherits = "release"
223224
split-debuginfo = "off"
224225
strip = false
225226

227+
[profile.release-dev]
228+
debug = "limited"
229+
inherits = "dev"
230+
split-debuginfo = "off"
231+
strip = false
232+
226233

227234
# the following lints rules are from https://github.com/biomejs/biome/blob/4bd3d6f09642952ee14445ed56af81a73796cea1/Cargo.toml#L7C1-L75C1
228235
[workspace.lints.rust]

crates/node_binding/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"build:release-prod:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release-prod",
3333
"build:release-prod:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release-prod",
3434
"build:release-debug": "node scripts/build.js --release-debug",
35+
"build:release-dev": "node scripts/build.js --release-dev",
3536
"move-binding": "node scripts/move-binding",
3637
"test": "tsc -p tsconfig.type-test.json"
3738
},

crates/node_binding/scripts/build.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ const CARGO_SAFELY_EXIT_CODE = 0;
99
let release = process.argv.includes("--release");
1010
// Slower release for production with `fat` LTO
1111
let releaseProd = process.argv.includes("--release-prod");
12+
// release with debug
1213
let releaseDebug = process.argv.includes("--release-debug");
14+
let releaseDev = process.argv.includes("--release-dev");
1315
let watch = process.argv.includes("--watch");
1416

1517
build().then((value) => {
@@ -44,6 +46,9 @@ async function build() {
4446
if (releaseDebug) {
4547
args.push('--profile release-debug');
4648
}
49+
if (releaseDev) {
50+
args.push('--profile release-dev')
51+
}
4752
if (watch) {
4853
args.push("--watch");
4954
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"build:binding:release": "pnpm --filter @rspack/binding run build:release",
3333
"build:binding:release-debug": "pnpm --filter @rspack/binding run build:release-debug",
3434
"build:binding:release-prod": "pnpm --filter @rspack/binding run build:release-prod",
35+
"build:binding:release-dev": "pnpm --filter @rspack/binding run build:release-dev",
3536
"prepare": "is-ci || husky",
3637
"test:diff": "pnpm --filter \"@rspack/*\" test:diff",
3738
"test:hot": "pnpm --filter \"@rspack/*\" test:hot",

0 commit comments

Comments
 (0)