Skip to content

(Local Modules) Imported JSON does not change based on require string, (only filename). #123

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

Closed
ashtonsix opened this issue Aug 11, 2015 · 0 comments

Comments

@ashtonsix
Copy link

I have a custom CSS pre-processor and webpack loader (gss). It is configurable via query strings - for example import headerStyle from 'gss?config=headerStyle.json!navbar.gss';. css-loader is set as a postloader in my webpack config.

This works perfectly, the navbar is configured to look like a header and headerStyle is an object with my hashed classes. The issue appears when the stylesheet is used multiple times. footer.js contains: import footerStyle from 'gss?config=footerStyle.json!navbar.gss';.

In this case both stylesheets are correctly generated and appear in the resulting CSS file, however the objects footerStyle and headerStyle are identical, they both point to the last sheet that was loaded.

Is it possible to make css-loader resolve files based on the entire require string rather than just the filename?

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

No branches or pull requests

2 participants