-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathvite.config.ts
More file actions
32 lines (30 loc) · 977 Bytes
/
vite.config.ts
File metadata and controls
32 lines (30 loc) · 977 Bytes
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
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
import licensePlugin from 'vite-plugin-banner'
import { dependencies, version } from './package.json'
import banner2 from 'rollup-plugin-banner2'
const licenseContents = `FingerprintJS Pro React v${version} - Copyright (c) FingerprintJS, Inc, ${new Date().getFullYear()} (https://fingerprint.com)
Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.`
export default defineConfig({
build: {
// Bundle source maps for easier debugging
sourcemap: true,
lib: {
entry: 'src/index.ts',
fileName: 'fingerprint-react',
formats: ['cjs', 'es'],
},
rollupOptions: {
plugins: [banner2(() => `'use client';\n`)],
external: ['react', 'react-dom', 'react/jsx-runtime', ...Object.keys(dependencies)],
},
},
plugins: [
licensePlugin({
content: licenseContents,
}),
dts({
rollupTypes: true,
}),
],
})