-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
33 lines (32 loc) · 1.09 KB
/
Copy pathrollup.config.js
File metadata and controls
33 lines (32 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
import { defineConfig } from "rollup";
import commonjs from "@rollup/plugin-commonjs";
import noderesolve from "@rollup/plugin-node-resolve";
import { terser } from "rollup-plugin-terser";
import ts from "rollup-plugin-ts";
import babel from "@rollup/plugin-babel";
import rollupExternalModules from "rollup-external-modules";
export default defineConfig({
external: rollupExternalModules,
plugins: [
noderesolve(),
commonjs(),
ts({ transpiler: "typescript" }),
babel({
extensions: [".js", ".jsx", ".es6", ".es", ".mjs", ".ts"],
babelHelpers: "bundled",
plugins: [
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining",
],
}),
terser({
compress: { drop_console: true, drop_debugger: true },
output: { beautify: true, comments: false },
}),
],
input: "./src/index.ts",
output: [
{ format: "esm", file: "dist/index.js" },
{ format: "cjs", file: "dist/index.cjs" },
],
});