Checklist
I have a project that contains a custom-elements-manifest.config.js file that contains the following:
export default {
exclude: [
"coverage/**",
"src/stories/**",
"storybook-static/**",
],
};
The excludes are not being honored, as evidenced by the generated custom-elements.json file containing descriptions of things found in files under the coverage directory. I debugged this and discovered an issue in the getUserConfig function defined in packages/analyzer/src/utils/cli-helpers.js. The object it returns looks like this:
{
__esModule: true,
default: {
exclude: [
'coverage/**',
'custom-elements-manifest/**',
'src/stories/**',
'storybook-static/**'
]
}
}
I expected it to look like this:
{
exclude: [
'coverage/**',
'custom-elements-manifest/**',
'src/stories/**',
'storybook-static/**'
]
}
This is a problem in the mergeGlobsAndExcludes function which contains this line:
...(userConfig?.exclude?.map((i) => `!${i}`) || []),
The reason is that the userConfig object doesn't have an exclude property. Instead it has a default property whose value is an object that has an exclude property.
Expected behavior
I expected the excludes described in the config file to be honored.
Checklist
--devflag to get more information?I have a project that contains a
custom-elements-manifest.config.jsfile that contains the following:The excludes are not being honored, as evidenced by the generated
custom-elements.jsonfile containing descriptions of things found in files under thecoveragedirectory. I debugged this and discovered an issue in thegetUserConfigfunction defined inpackages/analyzer/src/utils/cli-helpers.js. The object it returns looks like this:I expected it to look like this:
This is a problem in the
mergeGlobsAndExcludesfunction which contains this line:The reason is that the
userConfigobject doesn't have anexcludeproperty. Instead it has adefaultproperty whose value is an object that has anexcludeproperty.Expected behavior
I expected the excludes described in the config file to be honored.