Skip to content

Commit 64da172

Browse files
committed
Normalize to forward slashes on Windows too. Eleventy normalizes this in post but this change fixes the CI tests on Windows too.
1 parent b841c9f commit 64da172

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

main.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const path = require("path");
2+
const { TemplatePath } = require("@11ty/eleventy-utils");
23

34
function getAbsolutePath(filename) {
45
let normalizedFilename = path.normalize(filename); // removes dot slash
@@ -113,7 +114,14 @@ function getDependenciesFor(filename, avoidCircular, optionsArg = {}) {
113114
}
114115

115116
function getCleanDependencyListFor(filename, options = {}) {
116-
return Array.from( getDependenciesFor(filename, null, options) );
117+
let deps = Array.from( getDependenciesFor(filename, null, options) );
118+
119+
return deps.map(filePath => {
120+
if(filePath.startsWith("./")) {
121+
return TemplatePath.standardizeFilePath(filePath);
122+
}
123+
return filePath; // node_module name
124+
});
117125
}
118126

119127
module.exports = getCleanDependencyListFor;

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@
2727
"devDependencies": {
2828
"@sindresorhus/is": "^4.6.0",
2929
"ava": "^5.3.1"
30+
},
31+
"dependencies": {
32+
"@11ty/eleventy-utils": "^1.0.2"
3033
}
3134
}

0 commit comments

Comments
 (0)