-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrollup.config.js
57 lines (52 loc) · 1.26 KB
/
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
49
50
51
52
53
54
55
56
57
import typescript from "rollup-plugin-typescript2";
import dts from "rollup-plugin-dts";
import { terser } from "rollup-plugin-terser";
import { defineConfig } from "rollup";
import css from 'rollup-plugin-css-only'
const packages = [{ packageName: 'slideValidator', path: './packages/slideValidator' }];
const rollOpts = [];
packages.forEach(obj => {
const rollObj = {
plugins: [
typescript(),
css(),
terser()],
external: ["vue-demi"],
input: obj.path + '/index.ts',
output: [
{
format: "esm",
compact: true,
file: obj.path + '/dist/index.esm.js',
sourcemap: true,
},
{
compact: true,
format: "cjs",
file: obj.path + '/dist/index.cjs.js',
sourcemap: true,
exports: "default",
},
{
file: obj.path + '/dist/index.global.js',
format: "umd",
name: obj.packageName,
compact: true,
sourcemap: true,
globals: {
"vue-demi": "VueDemi",
},
},
],
};
rollOpts.push(rollObj);
rollOpts.push({
input: obj.path + '/index.ts',
plugins: [dts()],
output: {
file: obj.path + '/dist/index.d.ts',
format: "es",
},
})
})
export default defineConfig(rollOpts)