forked from aguingand/tiptap-markdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
43 lines (42 loc) · 1.23 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
/// <reference types="vitest" />
import * as path from 'node:path';
import { defineConfig } from 'vite';
import { babel } from '@rollup/plugin-babel';
import packageJson from './package.json'
export default defineConfig(() => {
const deps = {
...(packageJson.dependencies || {}),
...(packageJson.peerDependencies || {}),
}
return {
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.js'),
name: 'tiptap-markdown',
fileName: (format) => `tiptap-markdown.${format}.js`,
formats: ['es', 'umd'],
},
rollupOptions: {
external: [
...Object.keys(deps),
/^@tiptap/,
],
},
sourcemap: true,
minify: false,
},
plugins: [
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
}),
],
test: {
environment: 'jsdom',
setupFiles: [
path.resolve(__dirname, '__tests__/utils/setup.js'),
path.resolve(__dirname, '__tests__/utils/setup-dom.js'),
],
}
}
});