forked from ritwickdey/vscode-live-sass-compiler
-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathrollup.config.ts
43 lines (41 loc) · 1.29 KB
/
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
38
39
40
41
42
43
import { RollupOptions } from "rollup";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import terser from "@rollup/plugin-terser";
import json from "@rollup/plugin-json";
import commonjs from "@rollup/plugin-commonjs";
import { argv } from "process";
const isTest = argv.includes("--testing");
export default {
input: "src/extension.ts",
external: "vscode",
output: [
{
file: "out/extension.js",
format: "cjs",
sourcemap: isTest,
compact: true,
plugins: [
{
name: "navigtorFix",
renderChunk(code) {
return {
code: `var navigator=null!==navigator&&void 0!==navigator?navigator:navigator={userAgent:null};${code}`,
map: null,
};
},
},
],
},
],
plugins: [
typescript({ sourceMap: isTest, tsconfig: "src/tsconfig.rollup.json" }),
json(),
terser({ format: { comments: false } }),
commonjs({
ignoreDynamicRequires: true,
sourceMap: false,
}),
nodeResolve(),
],
} as RollupOptions;