forked from EddieDover/Theater-of-the-Mind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
35 lines (33 loc) · 1019 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
import copy from "rollup-plugin-copy";
import { nodeResolve } from "@rollup/plugin-node-resolve";
// Due to rollup-plugin-copy being garbage with globbing,
// switching to https://github.com/paulmelnikow/rollup-plugin-cpy may be necessary in the future.
export default () => ({
input: "src/module/theater-of-the-mind.js",
output: {
dir: "dist/module",
format: "es",
sourcemap: true,
},
plugins: [
nodeResolve(),
copy({
targets: [
{ src: "*.md", dest: "dist" },
{
src: "example_templates/**/*.json",
dest: "dist/example_templates",
rename(fname, extension, fullPath) {
fullPath = fullPath.replace("example_templates/", "");
fullPath = fullPath.replace(`/${fname}.${extension}`, "");
if (extension === "json") {
return `${fullPath}/${fname}.json`;
}
return `${fullPath}/${fname}.${extension}`;
},
},
],
verbose: true,
}),
],
});