-
Notifications
You must be signed in to change notification settings - Fork 4
/
custom-elements-manifest.config.mjs
40 lines (37 loc) · 1.44 KB
/
custom-elements-manifest.config.mjs
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
33
34
35
36
37
38
39
40
import { customElementVsCodePlugin } from "custom-element-vs-code-integration";
const outdir = './'
const options = {};
export default {
// blijkbaar mag ik niet ['src/lib/**/qti-*.ts'] doen, omdat inherited props dan niet mee worden genomen
// zoals de props in choices die overgeerfd wordt in qti-choice-interaction
globs: ['src/lib/**'],
exclude: [
'src/**/qti-*.stories.ts',
'src/**/qti-*.test.ts',
'src/**/qti-*.spec.ts',
'src/**/qti-*.styles.ts'
],
outdir: '',
litelement: true,
plugins: [
{
name: 'qti-strip-attributes',
packageLinkPhase({ customElementsManifest }) {
customElementsManifest?.modules?.forEach((module) => {
module?.declarations?.forEach((declaration) => {
Object.keys(declaration).forEach((key) => {
if (Array.isArray(declaration[key])) {
if (key == "members") declaration[key] = [];
// declaration[key] = declaration[key].filter((member) => member.hasOwnProperty('attribute'));
declaration[key] = declaration[key].filter((member) => !member.privacy?.includes('private'));
declaration[key] = declaration[key].filter((member) => !member.privacy?.includes('protected'));
declaration[key] = declaration[key].filter((member) => !member.name?.startsWith('_'));
}
});
});
});
}
},
customElementVsCodePlugin(options)
],
};