2020-11-18 01:08:24 +13:00
|
|
|
import alias from "@rollup/plugin-alias"
|
2020-05-08 09:15:09 +12:00
|
|
|
import commonjs from "@rollup/plugin-commonjs"
|
2020-11-18 01:08:24 +13:00
|
|
|
import resolve from "@rollup/plugin-node-resolve"
|
|
|
|
import replace from "@rollup/plugin-replace"
|
|
|
|
import svelte from "rollup-plugin-svelte"
|
2020-08-13 04:41:12 +12:00
|
|
|
import postcss from "rollup-plugin-postcss"
|
2020-10-13 05:54:18 +13:00
|
|
|
import { terser } from "rollup-plugin-terser"
|
2020-11-14 04:42:32 +13:00
|
|
|
import path from "path"
|
2019-08-20 08:18:23 +12:00
|
|
|
|
2020-10-15 21:04:57 +13:00
|
|
|
const production = !process.env.ROLLUP_WATCH
|
2020-11-14 04:42:32 +13:00
|
|
|
const projectRootDir = path.resolve(__dirname)
|
2020-08-27 04:03:30 +12:00
|
|
|
|
2019-08-20 08:18:23 +12:00
|
|
|
export default {
|
2020-02-03 22:24:25 +13:00
|
|
|
input: "src/index.js",
|
|
|
|
output: [
|
|
|
|
{
|
|
|
|
file: "dist/index.js",
|
|
|
|
format: "esm",
|
|
|
|
name: "budibaseStandardComponents",
|
2020-11-18 01:08:24 +13:00
|
|
|
sourcemap: false,
|
2020-02-03 22:24:25 +13:00
|
|
|
},
|
|
|
|
],
|
|
|
|
plugins: [
|
2020-11-14 04:42:32 +13:00
|
|
|
alias({
|
|
|
|
entries: [
|
|
|
|
{
|
|
|
|
find: "@budibase/component-sdk",
|
|
|
|
replacement: path.resolve(
|
|
|
|
projectRootDir,
|
|
|
|
"../component-sdk/dist/budibase-component-sdk"
|
|
|
|
),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}),
|
2020-10-15 21:04:57 +13:00
|
|
|
production && terser(),
|
2020-11-18 01:08:24 +13:00
|
|
|
postcss(),
|
2020-02-03 22:24:25 +13:00
|
|
|
svelte({
|
2020-11-18 01:08:24 +13:00
|
|
|
dev: !production,
|
2020-02-03 22:24:25 +13:00
|
|
|
}),
|
2020-05-08 09:15:09 +12:00
|
|
|
resolve({
|
|
|
|
browser: true,
|
|
|
|
}),
|
2020-11-18 01:08:24 +13:00
|
|
|
commonjs(),
|
|
|
|
// Fix for https://github.com/sveltejs/svelte/issues/3165
|
|
|
|
replace({
|
|
|
|
"outros.c.push":
|
|
|
|
"if (outros === undefined) { block.o(local); return }\noutros.c.push",
|
2020-08-27 04:03:30 +12:00
|
|
|
}),
|
2020-02-03 22:24:25 +13:00
|
|
|
],
|
|
|
|
}
|