forked from omp-node/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
36 lines (33 loc) · 1.09 KB
/
Copy pathrollup.config.mjs
File metadata and controls
36 lines (33 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
34
35
36
import path from "node:path";
import { createRequire } from "node:module";
import esbuild from "rollup-plugin-esbuild";
import del from "rollup-plugin-delete";
import externals from "rollup-plugin-node-externals";
import dts from "rollup-plugin-dts";
import { typescriptPaths } from "rollup-plugin-typescript-paths";
import json from "@rollup/plugin-json";
const require = createRequire(import.meta.url);
const { compilerOptions } = require("./tsconfig.json");
const inputPath = path.resolve("./", `src/main.ts`);
const outputPath = path.resolve("./", `dist`);
export default [
{
input: inputPath,
output: [
{ file: outputPath + "/bundle.js", format: "cjs" },
{ file: outputPath + "/bundle.mjs", format: "es" },
],
plugins: [
del({ targets: outputPath + "/*" }),
esbuild({ target: "node16.13", minify: true }),
typescriptPaths({ preserveExtensions: true }),
externals(),
json(),
],
},
{
input: inputPath,
output: [{ file: outputPath + "/bundle.d.ts" }],
plugins: [dts({ compilerOptions: { paths: compilerOptions.paths } })],
},
];