Open
Conversation
Contributor
Author
|
If the concept / design is accepted, I'm happy to create tests and documentation. The default behaviour was changed in #9, but I suggest to add this as a feature, and let the user of this plugin decide, if they want default or named exports (with its limitations). |
|
I submitted a bug report to TypeScript about lack of support for string literal exports, since this is a feature in plain JavaScript: microsoft/TypeScript#56200 |
|
Got a comment with a pointer to another issue. I believe you can export raw string names via |
laverdet
added a commit
to laverdet/css-modules-typescript-loader
that referenced
this pull request
Oct 24, 2023
BREAKING CHANGE: Updates the declaration template. This is a followup on seek-oss#38 The `exports =` declaration was added in e7342df but removed in 908d491 due some issue in babel which I can't reproduce. Maybe that has been fixed downstream in the meantime. Due to microsoft/TypeScript#40594 we cannot export these names directly since class names might not be valid JavaScript identifiers, even though they are valid exported names. When that TypeScript bug is resolved this can be changed to export the names directly instead of using `export =`. The problem with `export =` is that it will let you do `import * as css from ...` in addition to `import css from ...` even though only `import *` will work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #37
It has one known limitation. Exported class names has to JS safe - eg. we can't use dash in class names.