Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Normalize purge paths #118

Merged
merged 1 commit into from
Mar 19, 2021
Merged

Normalize purge paths #118

merged 1 commit into from
Mar 19, 2021

Conversation

bradlc
Copy link
Contributor

@bradlc bradlc commented Mar 19, 2021

Fixes #107

chokidar and fast-glob both expect paths to use forward slashes.

Because we use path.resolve to define the purge paths in our tests, this results in Windows-style paths when running on Windows. This caused the issue described in #107.

This PR uses normalize-path to ensure that the paths passed to chokidar and fast-glob are what they expect.

Alternatives

We could use normalize-path in our tests, and make it clear in the docs that the purge paths should use forward slashes, but this PR means that people can do stuff like we did in the tests without worrying about it:

module.exports = {
  // currently this doesn't work on Windows
  purge: [path.resolve(__dirname, './index.html')],
}

chokidar and fast-glob expect paths to use forward slashes
@adamwathan adamwathan merged commit 387fdb1 into main Mar 19, 2021
@adamwathan
Copy link
Member

Thanks! 👊

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PostCSS output result is empty in windows machine
2 participants