-
Notifications
You must be signed in to change notification settings - Fork 53
/
rollup.config.mjs
45 lines (42 loc) · 1.34 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
37
38
39
40
41
42
43
44
45
import fs from "fs";
import path from "path";
import getSystemPath from "./foundry-path.mjs";
import copy from 'rollup-plugin-copy-watch';
import postcss from "rollup-plugin-postcss"
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`, `./style/${manifest.id}.scss`],
output: {
dir : systemPath
// 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"]
}),
postcss({
extract : `${manifest.id}.css`,
plugins: []
})
],
onwarn(warning, warn) {
// suppress eval warnings
if (warning.code === 'EVAL') return
warn(warning)
}
}