-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathvite.config.js
31 lines (29 loc) · 910 Bytes
/
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
/// <reference types="vitest/config" />
import { createRequire } from 'module';
import { resolve } from 'path';
import { defineConfig } from 'vitest/config';
const require = createRequire(import.meta.url);
const pkg = require('./package.json');
export default defineConfig({
plugins: [],
build: {
outDir: 'lib/',
emptyOutDir: true,
lib: {
entry: resolve(__dirname, 'src/LocalizedStrings.ts'),
name: 'LocalizedStrings',
formats: ['es', 'umd'],
fileName: (format) => `LocalizedStrings.${format}.js`,
},
rollupOptions: {
external: [
...(pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : []),
],
},
},
test: {
globals: true,
environment: 'jsdom',
include: ['spec/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
},
});