budibase/packages/client/rollup.config.js

43 lines
943 B
JavaScript
Raw Normal View History

import commonjs from "@rollup/plugin-commonjs"
import resolve from "@rollup/plugin-node-resolve"
import svelte from "rollup-plugin-svelte"
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"
const production = !process.env.ROLLUP_WATCH
2019-09-06 14:04:23 +02:00
export default {
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",
file: `./dist/budibase-client.js`,
},
],
2021-04-01 14:44:14 +02:00
external: ["svelte", "svelte/internal"],
plugins: [
2021-04-01 14:44:14 +02:00
builtins(),
svelte({
dev: !production,
2021-04-01 14:44:14 +02:00
emitCss: true,
}),
2021-04-01 14:44:14 +02:00
postcss(),
resolve({
preferBuiltins: true,
browser: true,
dedupe: ["svelte", "svelte/internal"],
}),
2020-08-06 22:12:35 +02:00
commonjs(),
2021-04-01 14:44:14 +02:00
svg(),
json(),
production && terser(),
],
watch: {
clearScreen: false,
},
}