From dda22ef8ea12ebbfd69ab0eb6f1330574c994cee Mon Sep 17 00:00:00 2001 From: Felix Rabe Date: Mon, 13 Jul 2020 01:59:02 +0200 Subject: [PATCH 1/2] Update WASMbindgenAsset.js --- WASMbindgenAsset.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WASMbindgenAsset.js b/WASMbindgenAsset.js index 4ff1d17..aecab36 100644 --- a/WASMbindgenAsset.js +++ b/WASMbindgenAsset.js @@ -30,7 +30,7 @@ class WASMbindgenAsset extends Asset { return super.process() } - isTragetRust() { + isTargetRust() { return path.basename(this.name) === 'Cargo.toml' || path.extname(this.name) === '.rs' } @@ -49,7 +49,7 @@ class WASMbindgenAsset extends Asset { } async parse(code) { - if (!this.isTragetRust()) { + if (!this.isTargetRust()) { if (this.isNormalTOML()) return toml.parse(code) else @@ -236,7 +236,7 @@ class WASMbindgenAsset extends Asset { } async collectDependencies() { - if (!this.isTragetRust()) + if (!this.isTargetRust()) return false // Read deps file @@ -253,7 +253,7 @@ class WASMbindgenAsset extends Asset { } async generate() { - if (this.isTragetRust()) { + if (this.isTargetRust()) { return [ { type: 'js', From 0bd34c68fd6e4e16174f9c8ab425fb4dac7ba599 Mon Sep 17 00:00:00 2001 From: Felix Rabe Date: Mon, 13 Jul 2020 02:14:05 +0200 Subject: [PATCH 2/2] Update WASMbindgenAsset.js --- WASMbindgenAsset.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WASMbindgenAsset.js b/WASMbindgenAsset.js index aecab36..42c4d48 100644 --- a/WASMbindgenAsset.js +++ b/WASMbindgenAsset.js @@ -155,7 +155,7 @@ class WASMbindgenAsset extends Asset { const export_names = [] js_content = js_content.replace(/export\ function\ \w+/g, x => { - const name = x.slice(15) + const name = x.slice(16) export_names.push(name) return '__exports.' + name + ' = function' }) @@ -169,7 +169,7 @@ class WASMbindgenAsset extends Asset { const exported_classes = [] js_content = js_content.replace(/export\ class\ \w+/g, x => { - const name = x.slice(12) + const name = x.slice(13) exported_classes.push(name) export_names.push(name) return `class ${name}`