-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
37 lines (34 loc) · 935 Bytes
/
rollup.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
37
/*
* Copyright (c) 1986-2024 Ecmel Ercan (https://ecmel.dev/)
* Licensed under the MIT License
*/
import { defineConfig } from "rollup";
import { cleandir } from "rollup-plugin-cleandir";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import terser from "@rollup/plugin-terser";
const debug = process.env.ROLLUP_WATCH === "true";
process.env.NODE_ENV = debug ? "development" : "production";
export default defineConfig({
input: "src/extension.ts",
output: {
dir: "dist",
format: "commonjs",
sourcemap: debug,
},
onwarn(warning, warn) {
if (warning.code === "CIRCULAR_DEPENDENCY") {
return;
}
warn(warning);
},
external: ["vscode"],
plugins: [
cleandir(),
resolve({ preferBuiltins: true }),
commonjs(),
typescript({ noEmit: true }),
!debug && terser(),
],
});