-
-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathrolldown.config.mjs
More file actions
42 lines (36 loc) · 1.01 KB
/
rolldown.config.mjs
File metadata and controls
42 lines (36 loc) · 1.01 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
import { sentryRollupPlugin } from "@sentry/rollup-plugin";
import dotenv from "dotenv";
import { defineConfig } from "rolldown";
import pkg from "./package.json" with { type: "json" };
dotenv.config();
const isProduction = process.env.NODE_ENV === "production";
const plugins = [];
if (isProduction) {
plugins.push(
sentryRollupPlugin({
org: "yevhenii-hyzyla",
project: "sweetpad",
release: { name: pkg.version },
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
);
}
export default defineConfig({
input: "./src/extension.ts",
output: {
file: "out/extension.js",
format: "cjs",
sourcemap: isProduction ? "hidden" : true,
minify: isProduction,
},
platform: "node",
external: ["vscode"],
transform: {
// rolldown requires `define` here, not at top level
define: {
GLOBAL_SENTRY_DSN: JSON.stringify(process.env.SENTRY_DSN ?? null),
GLOBAL_RELEASE_VERSION: isProduction ? JSON.stringify(pkg.version) : JSON.stringify("dev"),
},
},
plugins,
});