-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrolldown.config.ts
More file actions
33 lines (32 loc) · 899 Bytes
/
Copy pathrolldown.config.ts
File metadata and controls
33 lines (32 loc) · 899 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
33
import swc from '@rollup/plugin-swc'
import { defineConfig } from 'rolldown'
import { withFilter } from 'rolldown/filter'
import { esmExternalRequirePlugin } from 'rolldown/plugins'
export default defineConfig({
input: 'src/extension.ts',
external: ['vscode'],
output: {
file: `dist/extension.js`,
sourcemap: true,
},
platform: 'node',
plugins: [
// https://github.com/oxc-project/oxc/issues/9170
// TODO: also replace @swc-node/register in .vscode-test.mjs
withFilter(
swc({
swc: {
jsc: {
target: 'esnext',
parser: { decorators: true, syntax: 'typescript' },
transform: { decoratorVersion: '2023-11' },
},
},
}),
// Only run this transform if the file contains a decorator.
{ transform: { code: /\n\s*@/ } },
),
// https://github.com/npm/node-which/issues/174
esmExternalRequirePlugin({ external: [/^node:/, 'path'] }),
],
})