-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathcustom-elements-manifest.config.js
33 lines (31 loc) · 1.16 KB
/
custom-elements-manifest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { pfeCustomElementsManifestConfig } from '@patternfly/pfe-tools/custom-elements-manifest/config.js';
export default pfeCustomElementsManifestConfig({
globs: ['elements/*/rh-*.ts'],
exclude: [
'*.css.js',
'elements/rh-icon/ssr.ts',
'elements/rh-icon/ssr.js',
],
plugins: [{
// because analyzer tooling does not support export paths,
// we here need to 'manually resolve' those paths in the manifest
// practically, this means removing the 'elements/' prefix
name: 'rhds-fix-module-exports-paths',
packageLinkPhase({ customElementsManifest }) {
const fix = path => path.replace(/^elements\//, '');
for (const mod of customElementsManifest.modules) {
mod.path &&= fix(mod.path);
for (const declaration of mod.declarations ?? []) {
if (declaration?.superClass?.module) {
declaration.superClass.module &&= fix(declaration.superClass.module);
}
}
for (const exportDecl of mod.exports ?? []) {
if (exportDecl?.declaration?.module) {
exportDecl.declaration.module &&= fix(exportDecl.declaration.module);
}
}
}
},
}],
});