2020-11-17 13:08:24 +01:00
|
|
|
import commonjs from "@rollup/plugin-commonjs"
|
|
|
|
import resolve from "@rollup/plugin-node-resolve"
|
2020-11-13 16:42:32 +01:00
|
|
|
import svelte from "rollup-plugin-svelte"
|
2021-01-30 01:20:13 +01:00
|
|
|
import { terser } from "rollup-plugin-terser"
|
2021-04-01 14:44:14 +02:00
|
|
|
import postcss from "rollup-plugin-postcss"
|
|
|
|
import svg from "rollup-plugin-svg"
|
|
|
|
import json from "rollup-plugin-json"
|
|
|
|
import builtins from "rollup-plugin-node-builtins"
|
2020-11-13 16:42:32 +01:00
|
|
|
|
|
|
|
const production = !process.env.ROLLUP_WATCH
|
2019-09-06 14:04:23 +02:00
|
|
|
|
|
|
|
export default {
|
2020-02-03 10:24:25 +01:00
|
|
|
input: "src/index.js",
|
|
|
|
output: [
|
|
|
|
{
|
2021-04-01 14:44:14 +02:00
|
|
|
sourcemap: false,
|
2021-01-07 15:53:18 +01:00
|
|
|
format: "iife",
|
2020-11-25 17:03:52 +01:00
|
|
|
file: `./dist/budibase-client.js`,
|
2020-02-03 10:24:25 +01:00
|
|
|
},
|
|
|
|
],
|
2021-04-01 14:44:14 +02:00
|
|
|
external: ["svelte", "svelte/internal"],
|
2020-02-03 10:24:25 +01:00
|
|
|
plugins: [
|
2021-04-01 14:44:14 +02:00
|
|
|
builtins(),
|
2020-11-13 16:42:32 +01:00
|
|
|
svelte({
|
|
|
|
dev: !production,
|
2021-04-01 14:44:14 +02:00
|
|
|
emitCss: true,
|
2020-11-13 16:42:32 +01:00
|
|
|
}),
|
2021-04-01 14:44:14 +02:00
|
|
|
postcss(),
|
2020-02-03 10:24:25 +01:00
|
|
|
resolve({
|
|
|
|
preferBuiltins: true,
|
|
|
|
browser: true,
|
2020-11-18 20:18:18 +01:00
|
|
|
dedupe: ["svelte", "svelte/internal"],
|
2020-02-03 10:24:25 +01:00
|
|
|
}),
|
2020-08-06 22:12:35 +02:00
|
|
|
commonjs(),
|
2021-04-01 14:44:14 +02:00
|
|
|
svg(),
|
|
|
|
json(),
|
2021-01-30 01:20:13 +01:00
|
|
|
production && terser(),
|
2020-02-03 10:24:25 +01:00
|
|
|
],
|
|
|
|
watch: {
|
|
|
|
clearScreen: false,
|
|
|
|
},
|
|
|
|
}
|