Skip to content

Bugfix: pa11y requires absolute paths for local files #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ const pluginCore = require('./pluginCore');
module.exports = {
async onPostBuild({
inputs: { checkPaths, ignoreDirectories, resultMode, debugMode },
constants: { PUBLISH_DIR },
utils: { build }
utils: { build },
netlifyConfig
}) {
const htmlFilePaths = await pluginCore.generateFilePaths({
fileAndDirPaths: checkPaths,
ignoreDirectories: ignoreDirectories || [],
PUBLISH_DIR
absolutePublishDir: netlifyConfig.build.publish
});
if (debugMode) {
console.log({ htmlFilePaths });
Expand Down
4 changes: 2 additions & 2 deletions plugin/pluginCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const runPa11yOnFile = async function(htmlFilePath, build) {
exports.generateFilePaths = async function({
fileAndDirPaths, // array, mix of html and directories
ignoreDirectories = [],
PUBLISH_DIR,
absolutePublishDir,
testMode,
debugMode
}) {
Expand All @@ -46,7 +46,7 @@ exports.generateFilePaths = async function({
);
const htmlFilePaths = await Promise.all(
fileAndDirPaths.map(fileAndDirPath =>
findHtmlFiles(`${PUBLISH_DIR}${fileAndDirPath}`, excludeDirGlobs)
findHtmlFiles(`${absolutePublishDir}${fileAndDirPath}`, excludeDirGlobs)
)
)
return [].concat(...htmlFilePaths)
Expand Down