-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
46 lines (42 loc) · 1.15 KB
/
vite.config.ts
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
/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/
import 'vitest/config';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig( {
build: {
target: 'esnext',
lib: {
entry: 'src/index',
fileName: 'index',
formats: [ 'es', 'umd' ],
name: 'CKEDITOR_INTEGRATIONS_COMMON'
},
sourcemap: true,
emptyOutDir: true,
minify: false
},
plugins: [
tsconfigPaths(),
dts( {
exclude: [ '**/*.test.ts', '**/*.test.tsx' ],
copyDtsFiles: true,
clearPureImport: false,
beforeWriteFile: ( filePath, content ) => {
// Force disable TypeScript checks for the CKEditor 5 Premium Features typings.
// CKEditor 5 Premium Features typings are optional and might be missing in the project.
// Some `tsconfig.json` with `skipLibCheck` set to `false` might fail to compile such project.
if ( content.includes( 'from \'ckeditor5-premium-features\'' ) ) {
content = `// @ts-nocheck\n${ content }`;
}
return {
filePath,
content
};
}
} )
]
} );