Comments (5)
this really should remove the main--red
instead of output it to file. I saw this issu and no reply, so I made my own type loader from this idea.
from css-modules-typescript-loader.
Our (current) philosophy is that we shouldn’t modify your classes in any way. If it’s something that TypeScript doesn’t allow, TypeScript should tell you—otherwise we’ll need to bloat up this loader with duplicated logic for detecting invalid identifiers.
from css-modules-typescript-loader.
Use css-loader
with option camelCase actually convert the main--red
to 2 set of keys mainRed
and main--red
, which both link to the same style. I did not mean to modify the existing class, but it should not be exported as a type file because its invaild TypeScript. You can access to the style with styles['main--red']
anyway without the type. for some people like to follow BEM pattern this should be acceptable or as a configuration.
The camelCase convertion css-loader
using is https://github.com/sindresorhus/camelcase
from css-modules-typescript-loader.
After re-reading the README, this might not be an issue when you're developing with a Webpack console window open.
Feel free to close if you guys think adding your own error handling is redundant or out-of-scope here
from css-modules-typescript-loader.
I've just proposed PR #9 which addresses this issue.
from css-modules-typescript-loader.
Related Issues (20)
- Place css-modules-typescript-loader directly after css-loader in your webpack config HOT 1
- Mode 'verify' and tests do not run on Windows HOT 3
- Use with CRA without ejecting? HOT 2
- declare const instead of var
- CSS Selectors using hyphens aren't compile-time checked due to square bracket access HOT 5
- Question: use generated TypeScript declaration in my React component. HOT 2
- Compatibility with modular-css
- Empty css.d.ts file HOT 2
- Cannot access directly the style from style object HOT 6
- Format output using Prettier
- style-loader docs is missing
- exporting of const=cssExports is redundant
- Support named exports
- Doesn't export fields with css-loader ^4.0.0 HOT 7
- npm file inclusion
- Cannot find module './Component.module.scss' and unused components
- Don't create typings files for non-named imports
- Definition file generated different in development compared to production mode
- Is it recommended to commit generated *.scss.d.ts files? HOT 1
- Generate app.d.css.ts instead of app.css.d.ts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from css-modules-typescript-loader.