-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
rollup.config.mjs
36 lines (34 loc) · 1.07 KB
/
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
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/fvtt-party-sheet.js",
output: {
dir: "dist/module",
format: "es",
sourcemap: true,
},
plugins: [
nodeResolve(),
copy({
targets: [
{ src: "*.md", dest: "dist" },
// { src: "example_templates/*", dest: "dist/example_templates" },
{
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,
}),
],
});