-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcustom-elements-manifest.config.mjs
49 lines (44 loc) · 1.61 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
41
42
43
44
45
46
47
48
49
import { customElementVsCodePlugin } from 'custom-element-vs-code-integration';
import { customEsLintRuleGeneratorPlugin } from 'custom-element-eslint-rule-generator';
import { customElementJsxPlugin } from 'custom-element-jsx-integration';
import { expandTypesPlugin, getTsProgram } from 'cem-plugin-expanded-types';
console.log('Building the custom element manifest...');
const outdir = './';
export default {
/** Globs to analyze */
globs: ['src/lib/qti-components/**/*.ts', 'src/lib/qti-item/**/*.ts', 'src/lib/qti-test/**/*.ts'],
/** Globs to exclude */
exclude: ['src/**/qti-*.stories.ts', 'src/**/qti-*.spec.ts', 'src/**/qti-*.styles.ts'],
/** Directory to output CEM to */
outdir: outdir,
/** Run in dev mode, provides extra logging */
dev: false,
/** Run in watch mode, runs on file changes */
watch: false,
/** Include third party custom elements manifests */
dependencies: false,
/** Output CEM path to `package.json`, defaults to true */
packagejson: false,
/** Enable special handling for litelement */
litelement: true,
overrideModuleCreation: ({ ts, globs }) => {
const program = getTsProgram(ts, globs, 'tsconfig.json');
return program.getSourceFiles().filter(sf => globs.find(glob => sf.fileName.includes(glob)));
},
plugins: [
expandTypesPlugin({
outdir: outdir + 'dist'
}),
customElementVsCodePlugin({
outdir: outdir + 'dist'
}),
customElementJsxPlugin({
outdir: outdir + 'dist',
exclude: [],
fileName: `qti-components-jsx.d.ts`
})
// customEsLintRuleGeneratorPlugin({
// outdir: outdir + 'dist'
// })
]
};