1
0
Fork 0
mirror of synced 2024-07-07 15:25:52 +12:00
budibase/packages/client/rollup.config.js
Adria Navarro 158703daef Bug - BUDI-6068 filters do not work for google sheets (#9886)
* Add data-utils with filters

* Create data-utils

* Add data-utils to compiled code

* Reuse constants

* Fix tests

* Rename package to shared-core

* Namespace export shared-core

* Rely on rollup to bundle shared-core

* Revert "Rely on rollup to bundle shared-core"

This reverts commit e8b5a2bb9a.

* Updating version and removing private.

* Update version

* Increment versions.

* Implement sort

* Enabling sort

* v2.3.21-alpha.2

* Fix build

* Improve readability

* Move deepGet to shared helper

* Better type usage

* Fix types

* Configure types

* Fix vite refs

* Add dep

* Fixing depencencies on client

* Add missing dev command

* Fix loading issues

* Update versions to latest

* Multiple es6 and commonjs configs

* Config

* Use local packages on rollup for client

* Change shared-core and types entry points

---------

Co-authored-by: mike12345567 <me@michaeldrury.co.uk>
2023-03-09 08:50:26 +00:00

117 lines
2.7 KiB
JavaScript

import commonjs from "@rollup/plugin-commonjs"
import resolve from "@rollup/plugin-node-resolve"
import alias from "@rollup/plugin-alias"
import svelte from "rollup-plugin-svelte"
import { terser } from "rollup-plugin-terser"
import postcss from "rollup-plugin-postcss"
import svg from "rollup-plugin-svg"
import image from "@rollup/plugin-image"
import json from "rollup-plugin-json"
import nodePolyfills from "rollup-plugin-polyfill-node"
import path from "path"
import { visualizer } from "rollup-plugin-visualizer"
const production = !process.env.ROLLUP_WATCH
const ignoredWarnings = [
"unused-export-let",
"css-unused-selector",
"module-script-reactive-declaration",
"a11y-no-onchange",
"a11y-click-events-have-key-events",
]
const devPaths = production
? []
: [
{
find: "@budibase/shared-core",
replacement: path.resolve("../shared-core/dist/mjs/src/index"),
},
{
find: "@budibase/types",
replacement: path.resolve("../types/dist/mjs/index"),
},
]
export default {
input: "src/index.js",
output: [
{
sourcemap: false,
format: "iife",
file: `./dist/budibase-client.js`,
},
],
onwarn(warning, warn) {
if (
warning.code === "THIS_IS_UNDEFINED" ||
warning.code === "CIRCULAR_DEPENDENCY"
) {
return
}
warn(warning)
},
plugins: [
alias({
entries: [
{
find: "manifest.json",
replacement: path.resolve("./manifest.json"),
},
{
find: "api",
replacement: path.resolve("./src/api"),
},
{
find: "components",
replacement: path.resolve("./src/components"),
},
{
find: "stores",
replacement: path.resolve("./src/stores"),
},
{
find: "utils",
replacement: path.resolve("./src/utils"),
},
{
find: "constants",
replacement: path.resolve("./src/constants"),
},
{
find: "sdk",
replacement: path.resolve("./src/sdk"),
},
...devPaths,
],
}),
svelte({
emitCss: true,
onwarn: (warning, handler) => {
// Ignore some warnings
if (!ignoredWarnings.includes(warning.code)) {
handler(warning)
}
},
}),
postcss(),
commonjs(),
nodePolyfills(),
resolve({
preferBuiltins: true,
browser: true,
dedupe: ["svelte", "svelte/internal"],
}),
svg(),
image({
exclude: "**/*.svg",
}),
json(),
production && terser(),
!production && visualizer(),
],
watch: {
clearScreen: false,
},
}