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"
|
2021-04-01 17:09:16 +02:00
|
|
|
import globals from "rollup-plugin-node-globals"
|
2020-11-13 16:42:32 +01:00
|
|
|
|
|
|
|
const production = !process.env.ROLLUP_WATCH
|
2021-04-01 20:25:56 +02:00
|
|
|
const ignoredWarnings = [
|
|
|
|
"unused-export-let",
|
|
|
|
"css-unused-selector",
|
|
|
|
"module-script-reactive-declaration",
|
|
|
|
"a11y-no-onchange",
|
|
|
|
]
|
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
|
|
|
},
|
|
|
|
],
|
|
|
|
plugins: [
|
2020-11-13 16:42:32 +01:00
|
|
|
svelte({
|
2021-04-01 14:44:14 +02:00
|
|
|
emitCss: true,
|
2021-04-01 20:25:56 +02:00
|
|
|
onwarn: (warning, handler) => {
|
|
|
|
// Ignore some warnings
|
|
|
|
if (!ignoredWarnings.includes(warning.code)) {
|
|
|
|
handler(warning)
|
|
|
|
}
|
|
|
|
},
|
2020-11-13 16:42:32 +01:00
|
|
|
}),
|
2021-04-01 14:44:14 +02:00
|
|
|
postcss(),
|
2021-04-01 17:09:16 +02:00
|
|
|
commonjs(),
|
|
|
|
globals(),
|
|
|
|
builtins(),
|
2020-02-03 10:24:25 +01:00
|
|
|
resolve({
|
|
|
|
preferBuiltins: true,
|
|
|
|
browser: true,
|
2021-04-01 20:41:54 +02:00
|
|
|
dedupe: ["svelte", "svelte/internal"],
|
2020-02-03 10:24:25 +01:00
|
|
|
}),
|
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,
|
|
|
|
},
|
|
|
|
}
|