Skip to content

Commit 7d114dc

Browse files
committed
Add env option to skip building front-end Slow build.rs / rust analyzer #913
1 parent 715c590 commit 7d114dc

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.vscode/settings.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"**/node_modules": true,
99
"**/build": true,
1010
"**/coverage": true,
11-
"**/dist": true,
11+
"**/dist": true
1212
},
1313
"eslint.validate": [
1414
"javascript",
@@ -32,5 +32,10 @@
3232
"./svelte"
3333
],
3434
"typescript.preferences.preferTypeOnlyAutoImports": true,
35-
"rustTestExplorer.rootCargoManifestFilePath": "./Cargo.toml"
35+
"rustTestExplorer.rootCargoManifestFilePath": "./Cargo.toml",
36+
// This won't work in multi-root workspaces, could be fixed by using a rust-analyzer.toml once there is some more documentation on that.
37+
// For now you need to set this in your own vscode settings file.
38+
"rust-analyzer.cargo.extraEnv": {
39+
"ATOMICSERVER_SKIP_JS_BUILD": "true"
40+
}
3641
}

server/build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ struct Dirs {
2020
fn main() -> std::io::Result<()> {
2121
// Uncomment this line if you want faster builds during development
2222
// return Ok(());
23+
24+
// If the ATOMICSERVER_SKIP_JS_BUILD environment variable is set, skip the JS build
25+
if let Ok(env_skip) = std::env::var("ATOMICSERVER_SKIP_JS_BUILD") {
26+
if env_skip == "true" {
27+
p!("ATOMICSERVER_SKIP_JS_BUILD is set, skipping JS build.");
28+
return Ok(());
29+
}
30+
}
31+
2332
const BROWSER_ROOT: &str = "../browser/";
2433
let dirs: Dirs = {
2534
Dirs {

0 commit comments

Comments
 (0)