Skip to content

Fix class naming, path resolution, and broken tests on Windows - #49

Closed
akanix42 wants to merge 4 commits into
css-modules:masterfrom
akanix42:master
Closed

akanix42 wants to merge 4 commits into
css-modules:masterfrom
akanix42:master

Conversation

@akanix42

Copy link
Copy Markdown

I put this together to resolve #16, and have tested it on Windows and Mac.

It requires a bit of a hack to the postcss-modules-scope plugin. PostCSS converts the "from" path to an absolute path, so I've adjusted the scope plugin's generateScopedName function to make the path (and hence class name) relative to the FileSystemLoader's root.

Nathan Reid added 4 commits November 10, 2015 22:34
…tead of _relative_path_to_file) and broken path resolution ("composes" didn't work)
…o better reflect the path to the imported style
@Scrum

Scrum commented Feb 18, 2016

Copy link
Copy Markdown

👍 merge please !

@gimre

gimre commented Apr 18, 2016

Copy link
Copy Markdown

+1

@huan086

huan086 commented May 16, 2016

Copy link
Copy Markdown

Really hackish. Let say the original path is D:\folder1\folder2\script.js, the project is in D:\folder1. The path "resolves" to D:\folder2\script.js

@TrySound TrySound closed this Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Completely Fails on Windows

5 participants