Remove old rollup config and update tsconfig
This commit is contained in:
parent
cfa6d487f8
commit
d4c9e5140d
|
@ -1,111 +0,0 @@
|
|||
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"
|
||||
import typescript from "@rollup/plugin-typescript"
|
||||
|
||||
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",
|
||||
]
|
||||
|
||||
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" ||
|
||||
warning.code === "EVAL"
|
||||
) {
|
||||
return
|
||||
}
|
||||
warn(warning)
|
||||
},
|
||||
plugins: [
|
||||
typescript({
|
||||
include: [
|
||||
"src/**/*.ts",
|
||||
`${path.resolve("..")}/frontend-core/src/**/*.ts`,
|
||||
],
|
||||
}),
|
||||
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"),
|
||||
},
|
||||
],
|
||||
}),
|
||||
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"],
|
||||
extensions: [".js", ".ts", ".json"],
|
||||
}),
|
||||
svg(),
|
||||
image({
|
||||
exclude: "**/*.svg",
|
||||
}),
|
||||
json(),
|
||||
production && terser(),
|
||||
!production && visualizer(),
|
||||
],
|
||||
watch: {
|
||||
clearScreen: false,
|
||||
},
|
||||
}
|
|
@ -16,6 +16,5 @@
|
|||
],
|
||||
"*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*.ts", "../frontend-core/src/**/*.ts"]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue