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
Enables the outputting of the CSS modules mapping JSON. This can be omitted or set to a falsy value to disable any output.
1387
+
Enables a callback to output the CSS modules mapping JSON. The callback is invoked with two arguments:
1392
1388
1393
-
###### `boolean`
1389
+
-`resourcePath`: the absolutely path of the original resource, e.g., /foo/bar/baz.css
1390
+
-`json`: the CSS modules map object, e.g.,
1394
1391
1395
-
Possible values:
1392
+
```
1393
+
/* baz.css */
1396
1394
1397
-
-`true` - writes a JSON file next located in the same directory as the loaded resource file. For example, given a resource file located at /foo/bar/baz.css, this would write the CSS modules mapping JSON to /foo/bar/baz.css.json
Enables custom handling of the CSS modules mapping JSON output. The return value of the function is not used for anything internally and is only intended to customize output.
1423
1441
1424
-
**webpack.config.js**
1425
-
1426
-
```js
1442
+
// same as above, just asynchronous
1427
1443
module.exports= {
1428
1444
module: {
1429
1445
rules: [
@@ -1432,10 +1448,14 @@ module.exports = {
1432
1448
loader:"css-loader",
1433
1449
options: {
1434
1450
modules: {
1435
-
getJSON: (resourcePath, json, outputPath) => {
1436
-
// `resourcePath` is the original resource file path, e.g., /foo/bar/baz.css
1437
-
// `json` is the CSS modules map
1438
-
// `outputPath` is the expected output file path, e.g., /foo/bar/baz.css.json
0 commit comments