-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.mjs
47 lines (46 loc) · 960 Bytes
/
rollup.config.mjs
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
import esbuild from 'rollup-plugin-esbuild';
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import scss from "rollup-plugin-scss";
import terser from "@rollup/plugin-terser";
export default [
// Publish Script
{
input: "src/index.ts",
output: {
file: "publish.js",
format: "cjs",
},
plugins: [
esbuild(),
resolve({
preferBuiltins: true,
}),
commonjs(),
terser(),
],
},
// Static Source
{
input: "src/static/index.ts",
output: {
file: "static/main.js",
format: "cjs",
},
plugins: [
esbuild(),
resolve({
preferBuiltins: true,
}),
commonjs(),
terser(),
scss({
fileName: "main.css",
includePaths: ["src/static/styles"],
watch: "src/static/styles",
failOnError: true,
outputStyle: "compressed",
}),
],
},
];