forked from moo-man/WFRP4e-FoundryVTT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
39 lines (36 loc) · 1.14 KB
/
rollup.config.mjs
File metadata and controls
39 lines (36 loc) · 1.14 KB
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
import fs from "fs";
import path from "path";
import getSystemPath from "./foundry-path.mjs";
import copy from 'rollup-plugin-copy-watch';
import jscc from 'rollup-plugin-jscc';
let manifest = JSON.parse(fs.readFileSync("./system.json"))
let systemPath = getSystemPath(manifest.id)
console.log("Bundling to " + systemPath)
export default {
input: [`${manifest.id}.js`],
output: {
file : path.join(systemPath, `${manifest.id}.js`)
},
watch : {
clearScreen: true
},
plugins: [
jscc({
values : {_ENV : process.env.NODE_ENV}
}),
copy({
targets : [
{src : "./template.json", dest : systemPath},
{src : "./system.json", dest : systemPath},
{src : "./WFRP-Header.jpg", dest : systemPath},
{src : "./static/*", dest : systemPath},
],
watch: process.env.NODE_ENV == "production" ? false : ["./static/*/**", "system.json", "template.json"]
})
],
onwarn(warning, warn) {
// suppress eval warnings
if (warning.code === 'EVAL') return
warn(warning)
}
}