-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
47 lines (40 loc) · 1.01 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
import * as path from "path";
import { createRollupConfigs } from "./scripts/base.config.js";
import alias from "@rollup/plugin-alias";
import scss from "rollup-plugin-scss";
const production = !process.env.ROLLUP_WATCH;
export const config = {
staticDir: "static",
distDir: "dist",
buildDir: `dist/build`,
serve: !production,
production,
rollupWrapper: (rollup) => {
rollup.plugins = [
...rollup.plugins,
scss({
watch: "scss",
output: "static/css/app.css",
}),
alias({
entries: [{ find: "@", replacement: path.resolve("src") }],
}),
];
},
svelteWrapper: (svelte) => {},
swWrapper: (worker) => worker,
};
const configs = createRollupConfigs(config);
export default configs;
/**
Wrappers can either mutate or return a config
wrapper example 1
svelteWrapper: (cfg, ctx) => {
cfg.preprocess: mdsvex({ extension: '.md' }),
}
wrapper example 2
rollupWrapper: cfg => {
cfg.plugins = [...cfg.plugins, myPlugin()]
return cfg
}
*/