-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathrollup.config.js
39 lines (35 loc) · 1.11 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
const fs = require("fs")
const path = require("path")
const foundryPath = require("./foundry-path.js");
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 = foundryPath.systemPath(manifest.id)
console.log("Bundling to " + systemPath)
export default {
input: [`./scripts/${manifest.id}.js`, `./style/${manifest.id}.scss`],
output: {
dir : systemPath
},
watch : {
clareScreen: true
},
plugins: [
jscc({
values : {_ENV : process.env.NODE_ENV}
}),
copy({
targets : [
{src : "./template.json", dest : systemPath},
{src : "./system.json", dest : systemPath},
{src : "./static/*", dest : systemPath},
],
watch: process.env.NODE_ENV == "production" ? false : ["./static/*/**", "system.json", "template.json"]
}),
postcss({
extract : `${manifest.id}.css`,
plugins: []
})
]
}