-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathvite.config.ts
38 lines (33 loc) · 1 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
/// <reference types="vitest/config" />
import react from '@vitejs/plugin-react';
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: [react() as any],
build: {
outDir: 'lib/',
emptyOutDir: true,
lib: {
entry: resolve(__dirname, 'src/LocalizedStrings.tsx'),
name: 'ReactLocalization',
formats: ['es', 'umd'],
fileName: (format) => `react-localization.${format}.js`
},
rollupOptions: {
external: [...Object.keys(pkg.peerDependencies)],
output: {
globals: {
react: 'React'
}
}
}
},
test: {
globals: true,
environment: 'jsdom',
include: ['spec/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
}
});