-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
48 lines (44 loc) · 1.43 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
import svelte from "rollup-plugin-svelte"
import commonjs from "@rollup/plugin-commonjs"
import resolve from "@rollup/plugin-node-resolve"
import { terser } from "rollup-plugin-terser"
import pkg from "./package.json"
import preprocess from "svelte-preprocess"
import typescript from "@rollup/plugin-typescript"
const devMode = false
const bannerString = "/**\n" + "* SVELDITOR " + pkg.version + "\n" + "* @licence MIT\n"+ "*/";
export default {
input: "src/index.js",
treeshake: { moduleSideEffects: false },
output: [
{ banner: bannerString, file: pkg.module, format: "es", sourcemap: devMode },
{ banner: bannerString, file: pkg.main, format: "umd", name:"svelditor", sourcemap: devMode}
],
plugins: [
svelte({
preprocess: preprocess({
typescript: { transpileOnly: true }
})
}),
resolve({
browser: true,
dedupe: ["svelte"]
}),
commonjs(),
typescript(),
!devMode && terser({
output: {
comments: function (node, comment) {
var text = comment.value;
var type = comment.type;
if (type == "comment2") { return /@licence/i.test(text); }
}
},
mangle: false,
compress: {
pure_funcs: ["console.log", "console.info"]
}
}
)
]
}