generated from Volper212/svelte-trpc-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.ts
40 lines (38 loc) · 1.1 KB
/
rollup.config.ts
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
import svelte from "rollup-plugin-svelte";
import resolve from "@rollup/plugin-node-resolve";
import css from "rollup-plugin-css-only";
import sveltePreprocess from "svelte-preprocess";
import typescript from "@rollup/plugin-typescript";
import commonjs from "@rollup/plugin-commonjs";
import alias from "@rollup/plugin-alias";
const isDev = process.argv.includes("-cw");
export default {
input: "frontend/index.ts",
output: {
file: "frontend/public/bundle.js",
format: "iife",
sourcemap: isDev,
},
plugins: [
svelte({
onwarn(warning, handler) {
if (warning.code === "css-unused-selector") return;
handler(warning);
},
preprocess: sveltePreprocess(),
}),
resolve({ browser: true }),
typescript({
sourceMap: isDev,
}),
css({
output: "bundle.css",
}),
commonjs({
transformMixedEsModules: true,
}),
alias({
entries: [{ find: "frontend", replacement: "./frontend" }],
}),
],
};