-
Notifications
You must be signed in to change notification settings - Fork 77
/
vite.config.ts
83 lines (73 loc) · 1.49 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/
import { resolve } from 'path';
import { createRequire } from 'module';
import { defineConfig } from 'vitest/config';
import vue from '@vitejs/plugin-vue';
const require = createRequire( import.meta.url );
const pkg = require( './package.json' );
export default defineConfig( {
plugins: [
vue()
],
build: {
minify: false,
sourcemap: true,
target: 'es2019',
// https://vitejs.dev/guide/build#library-mode
lib: {
entry: resolve( __dirname, 'src/plugin.ts' ),
name: 'CKEDITOR_VUE',
fileName: 'ckeditor'
},
rollupOptions: {
external: Object.keys( {
...pkg.dependencies,
...pkg.peerDependencies
} ),
output: {
globals: {
'vue': 'Vue',
'lodash-es': '_',
'@ckeditor/ckeditor5-integrations-common': 'CKEDITOR_INTEGRATIONS_COMMON'
}
}
}
},
resolve: {
alias: [
{ find: 'vue', replacement: 'vue/dist/vue.esm-bundler.js' }
]
},
// https://vitest.dev/config/
test: {
include: [
'tests/**/*.test.[j|t]s'
],
coverage: {
provider: 'istanbul',
include: [ 'src/*' ],
thresholds: {
100: true
},
reporter: [
'text-summary',
'html',
'lcovonly',
'json'
]
},
browser: {
enabled: true,
headless: true,
provider: 'webdriverio',
name: 'chrome',
screenshotFailures: false
}
},
define: {
__VUE_INTEGRATION_VERSION__: JSON.stringify( pkg.version )
}
} );