-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
56 lines (55 loc) · 1.85 KB
/
vite.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/** @type {import('vite').UserConfig} */
import { resolve } from 'path'
export default {
build : {
target : 'esnext',
lib : {
entry : resolve( __dirname, 'src/custom-element/index.js' ),
name : 'CustomElement',
fileName: 'custom-element-bundle',
formats : [ 'es', 'cjs' ]
},
minify : true,
rollupOptions: {
preserveEntrySignatures: 'strict',
output : {
format : 'es',
exports : 'named',
externalLiveBindings: false,
// unbundled = bundle name is `*` file name without extension
manualChunks: function manualChunks( id )
{
if( id.endsWith( '.ts' ) )
{
// return file name without extension
return id.split( '/' ).pop().replace( '.ts', '' );
}
if( id.endsWith( '.js' ) )
{
// return file name without extension
return id.split( '/' ).pop().replace( '.js', '' );
}
},
},
},
},
test : {
isolate : true,
browser : {
provider: 'playwright', // or 'webdriverio'
enabled : true,
name : 'chromium', // browser name is required
headless: true,
},
include :
[ 'src/**/*.{test,spec}.?(c|m)[jt]s?(x)'
, 'src/stories/*.test.stories.ts'
],
coverage: {
reporter: [ 'text', 'json', 'html', 'coverage-svg' ],
provider: 'istanbul',
include : [ 'src' ]
}
},
publicDir: 'public'
}