diff --git a/rust/build.rs b/rust/build.rs index b0169e5..43feaea 100644 --- a/rust/build.rs +++ b/rust/build.rs @@ -22,6 +22,22 @@ fn main() { println!("stdout: {}", String::from_utf8_lossy(&output.stdout)); println!("stderr: {}", String::from_utf8_lossy(&output.stderr)); assert!(output.status.success()); + + // move webpack results to rust webserver src + let _ = Command::new("cmd") + .arg("/K") + .arg("move") + .arg("./src_webpack/bundle.js") + .arg("./src/webserver") + .output() + .unwrap(); + let _ = Command::new("cmd") + .arg("/K") + .arg("move") + .arg("./src_webpack/index.html") + .arg("./src/webserver") + .output() + .unwrap(); } Err(_) => { println!("Assuming build on linux"); @@ -34,6 +50,18 @@ fn main() { println!("stdout: {}", String::from_utf8_lossy(&output.stdout)); println!("stderr: {}", String::from_utf8_lossy(&output.stderr)); assert!(output.status.success()); + + // move webpack results to rust webserver src + let _ = Command::new("mv") + .arg("./src_webpack/bundle.js") + .arg("./src/webserver") + .output() + .unwrap(); + let _ = Command::new("mv") + .arg("./src_webpack/index.html") + .arg("./src/webserver") + .output() + .unwrap(); } } diff --git a/rust/src_webpack/webpack.config.js b/rust/src_webpack/webpack.config.js index 00e4ebc..fa36e6f 100644 --- a/rust/src_webpack/webpack.config.js +++ b/rust/src_webpack/webpack.config.js @@ -49,7 +49,7 @@ module.exports = { }, output: { filename: 'bundle.js', - path: path.resolve(__dirname, '../src/webserver'), + path: path.resolve(__dirname, '.'), }, devServer: { }