From 5d46d125e5907943df7964cb96fd567d19bf16bc Mon Sep 17 00:00:00 2001 From: Jordin Date: Fri, 3 Jul 2020 20:19:00 -0300 Subject: [PATCH] Fix wasm path handling in nested folders on Windows --- WASMbindgenAsset.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WASMbindgenAsset.js b/WASMbindgenAsset.js index 4ff1d17..1f35e6d 100644 --- a/WASMbindgenAsset.js +++ b/WASMbindgenAsset.js @@ -144,7 +144,7 @@ class WASMbindgenAsset extends Asset { let wasm_path = path.relative(path.dirname(this.name), path.join(loc, rustName + '_bg.wasm')) if (wasm_path[0] !== '.') wasm_path = './' + wasm_path - wasm_path = wasm_path.replace('\\', '/') + wasm_path = wasm_path.replace(/\\/g, '/') js_content = js_content.replace(/import\ \*\ as\ wasm.+?;/, 'var wasm;const __exports = {};') js_content = js_content.replace(/import.+?snippets.+?;/g, line => {