-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.js
48 lines (44 loc) · 1021 Bytes
/
rollup.config.js
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
44
45
46
47
48
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import babel from "@rollup/plugin-babel";
import { terser } from "rollup-plugin-terser";
import json from '@rollup/plugin-json';
import external from '@yelo/rollup-node-external';
// import nodePolyfills from "rollup-plugin-node-polyfills";
import pkg from "./package.json";
const name = "md2docx";
const plugins = [
// nodePolyfills(),
resolve({ preferBuiltins: true }),
commonjs(),
babel(),
json(),
];
/**
* key为包名称,value为全局引用的值
* example: const globals = { jquery: "$" };
*/
const globals = {};
export default [
{
input: "src/main.js",
output: [
{ //cjs setting
name,
file: pkg.main,
format: "cjs",
exports: "named",
globals
},
{ //esm setting
name,
file: pkg.module,
format: "es",
exports: "named",
globals
},
],
plugins,
external: external(),
}
];