-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathrollup.config.js
More file actions
54 lines (50 loc) · 1.09 KB
/
rollup.config.js
File metadata and controls
54 lines (50 loc) · 1.09 KB
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
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import resolve from '@rollup/plugin-node-resolve'
import { defineConfig } from 'rollup'
import oxc from 'unplugin-oxc/rollup'
import { createDtsUtils, externalDependencies } from '../../scripts/build-utils.js'
const external = [
...externalDependencies(import.meta.url),
]
const dtsUtils = createDtsUtils()
const plugins = [
resolve({
preferBuiltins: true,
}),
json(),
commonjs(),
oxc({
transform: { target: 'node20' },
}),
]
export default () =>
defineConfig([
{
input: {
index: './src/index.ts',
locators: './src/locators.ts',
},
output: {
dir: 'dist',
format: 'esm',
},
external,
context: 'null',
plugins: [
...dtsUtils.isolatedDecl(),
...plugins,
],
},
{
input: dtsUtils.dtsInput('src/index.ts'),
output: {
dir: 'dist',
entryFileNames: '[name].d.ts',
format: 'esm',
},
watch: false,
external,
plugins: dtsUtils.dts(),
},
])