-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrollup.config.js
86 lines (81 loc) · 2.16 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import svelte from "rollup-plugin-svelte";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import strip from '@rollup/plugin-strip';
import sveltePreprocess from "svelte-preprocess";
import { terser } from "rollup-plugin-terser";
import typescript from "@rollup/plugin-typescript";
import size from "rollup-plugin-bundle-size";
const plugins = [
svelte({
preprocess: sveltePreprocess(),
compilerOptions: {
// enable run-time checks when not in production
dev: false,
},
}),
strip({
include: ['**/*.js', "**/*.ts", "**/*.svelte"],
function: [ 'console.*', 'assert.*' ]
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration -
// consult the documentation for details:
// https://github.com/rollup/plugins/tree/master/packages/commonjs
resolve({
browser: true,
dedupe: ["svelte"],
}),
commonjs(),
typescript({
sourceMap: false,
}),
size(),
];
export default [
{
input: "packages/svelte-reactive-form/src/index.ts",
output: [
{
file: "packages/svelte-reactive-form/lib/index.min.js",
format: "iife",
name: "svelteReactiveForm",
plugins: [terser()],
},
{
file: "packages/svelte-reactive-form/lib/index.js",
format: "iife",
name: "svelteReactiveForm",
},
{
file: "packages/svelte-reactive-form/lib/cjs/index.js",
format: "cjs",
},
{
file: "packages/svelte-reactive-form/lib/esm/index.js",
format: "es",
},
],
plugins,
},
{
input: "packages/rules/src/index.ts",
output: [
{
file: "packages/rules/lib/index.min.js",
format: "iife",
name: "svelteReactiveFormRules",
plugins: [terser()],
},
{
file: "packages/rules/lib/index.js",
format: "iife",
name: "svelteReactiveFormRules",
},
{ file: "packages/rules/lib/cjs/index.js", format: "cjs" },
{ file: "packages/rules/lib/esm/index.js", format: "es" },
],
plugins,
},
];