You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,10 @@ Instead of emitting new TypeScript declarations, this will throw an error if a g
58
58
59
59
This workflow is similar to using the [Prettier](https://github.com/prettier/prettier)[`--list-different` option](https://prettier.io/docs/en/cli.html#list-different).
60
60
61
+
### Named Exports
62
+
63
+
If using the `namedExports` option of `css-loader` then you can enable the same option in this loader. This can improve tree shaking and reduce bundled JavaScript size by dropping the original class names.
64
+
61
65
## With Thanks
62
66
63
67
This package borrows heavily from [typings-for-css-modules-loader](https://github.com/Jimdo/typings-for-css-modules-loader).
0 commit comments