GitHunt
LE

leimonio/rspack-rule-description-data

Rspack Project

(a reproduction of descriptionData issue)

When using module.rules.descriptionData for filtering rules based on the module package.json data, descriptionData won't match custom package.json keys.

Setup + Run

pnpm install
pnpm run dev

Reproduce issue

Try each of descriptionData separately, from the rspack.config.js

descriptionData: {
    // 1. this works
    version: (versionData) => {
        console.log("๐Ÿš€ ~ file: rspack.config.js:97 ~ descriptionData:version", versionData);
        return true;
    },
    // 2. this doesn't work
    componentId: (componentIdData) => {
        console.log("๐Ÿš€ ~ file: rspack.config.js:102 ~ descriptionData:componentId", componentIdData);
        return true;
    },
    // 3. this doesn't work
    "_custom_key": (customKeyData) => {
        console.log("๐Ÿš€ ~ file: rspack.config.js:107 ~ descriptionData:_custom_key", customKeyData);
        return true;
    }
},

Custom package.json data:

"_custom_key": true,
"componentId": {
    "scope": "bitdev.react",
    "name": "examples/button",
    "version": "1.0.1"
},

Expected behaviour

descriptionData rule filtering is applied for custom package.json data.

Languages

JavaScript47.8%CSS25.6%TypeScript21.8%HTML4.3%MDX0.5%

Contributors

Created May 20, 2024
Updated June 5, 2024
leimonio/rspack-rule-description-data | GitHunt