gajus / gajus/babel-plugin-react-css-modules

Can I use webpack resolve.extensions = [".css"] and use import './table' instead of './table.css' in js

Offen
#295 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
2k
Forks
159
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Course
![image](https://user-images.githubusercontent.com/12373328/102491577-5f74af80-40ab-11eb-9d41-519c80ea6bf5.png)

// webpack.config.js

```
resolve: {
extensions: ['*', '.js', '.json', '.jsx', '.tsx', '.ts', '.css', '*.css', '.scss'],
},
```
// RuntimeStyleResolution.js
```
/**
* @file Demonstrates runtime "styleName" resolution.
* @see https://github.com/gajus/babel-plugin-react-css-modules#runtime-stylename-resolution
*/

import React from 'react';
import './table';

export default () => {
return



0.5 ? ' yellow' : '')}>A2

0.5 ? ' yellow' : '')}>B2

0.5 ? ' yellow' : '')}>C2


;
};

```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Read the webpack.config.js resolve.extensions example and the import in RuntimeStyleResolution.js. Check whether importing ./table without an extension works with the shown configuration and how that interacts with the plugin's CSS module resolution. Done means a reproducible answer or a narrowly scoped change request.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, react, webpack
Bereich
frontend, tooling
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.