From 45479fe943eea2fe4193a6d4b5315518e17c5280 Mon Sep 17 00:00:00 2001 From: Miguel Cubells Baeza Date: Mon, 14 Feb 2022 08:38:08 +0800 Subject: [PATCH 1/3] "require" statements must always be generated with unix-style paths --- module.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/module.js b/module.js index d596a04..9534d18 100644 --- a/module.js +++ b/module.js @@ -15,12 +15,16 @@ class Link extends Code { this.importedCodeRef = importedCodeRef; } + unixify(str) { + return str.replace(/[\\\/]+/g, '/'); + } + toString() { if (this.importedCodeRef.external) { - return `require('${this.importedCodeRef.getPath()}')`; + return `require('${this.unixify(this.importedCodeRef.getPath())}')`; } - const path = relative(Path.resolve(this.hostCodeRef.getPath(), '..'), - this.importedCodeRef.getPath()); + const path = this.unixify(relative(Path.resolve(this.hostCodeRef.getPath(), '..'), + this.importedCodeRef.getPath())); return `require('${/\./.test(path) ? path : `./${path}`}')`; } } From d94826c684815461cca1a092b1b359791ab2f69b Mon Sep 17 00:00:00 2001 From: Dmytro Semenov Date: Mon, 14 Feb 2022 15:28:29 -0800 Subject: [PATCH 2/3] Update .travis.yml --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index eb39ffd..c78256b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ +os: + - linux + - windows node_js: -- "8" -- "10" +- "14" +- "16" language: node_js install: - npm install @@ -8,4 +11,4 @@ install: script: - npm test - istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec -- codecov \ No newline at end of file +- codecov From 7514a58da86ec062288371f68a95fc67f71757fa Mon Sep 17 00:00:00 2001 From: Dmytro Semenov Date: Mon, 14 Feb 2022 15:56:19 -0800 Subject: [PATCH 3/3] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c78256b..27ef2e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ os: - linux - windows + node_js: - "14" - "16"