Tidy up dependencies and rollup configs for client and standard components

This commit is contained in:
Andrew Kingston 2020-11-25 16:03:52 +00:00
parent 1e857f101a
commit b607d2e933
4 changed files with 3 additions and 154 deletions

View File

@ -10,14 +10,8 @@ export default {
output: [ output: [
{ {
sourcemap: true, sourcemap: true,
format: "iife",
name: "app",
file: `./dist/budibase-client.js`,
},
{
file: "dist/budibase-client.esm.mjs",
format: "esm", format: "esm",
sourcemap: "inline", file: `./dist/budibase-client.js`,
}, },
], ],
plugins: [ plugins: [

View File

@ -6,7 +6,6 @@
"build": "rollup -c", "build": "rollup -c",
"prepublishOnly": "npm run build", "prepublishOnly": "npm run build",
"postpublish": "node scripts/deploy.js", "postpublish": "node scripts/deploy.js",
"testbuild": "rollup -w -c rollup.testconfig.js",
"dev": "run-p start:dev testbuild", "dev": "run-p start:dev testbuild",
"start:dev": "sirv public --single --dev", "start:dev": "sirv public --single --dev",
"dev:builder": "rollup -cw" "dev:builder": "rollup -cw"
@ -23,10 +22,7 @@
"rollup-plugin-postcss": "^3.1.5", "rollup-plugin-postcss": "^3.1.5",
"rollup-plugin-svelte": "^6.1.1", "rollup-plugin-svelte": "^6.1.1",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"shortid": "^2.2.15", "sirv-cli": "^0.4.4",
"sirv-cli": "^0.4.4"
},
"peerDependencies": {
"svelte": "^3.29.0" "svelte": "^3.29.0"
}, },
"keywords": [ "keywords": [
@ -36,12 +32,10 @@
"license": "MIT", "license": "MIT",
"gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691", "gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691",
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.50.1", "@budibase/bbui": "^1.51.0",
"@budibase/svelte-ag-grid": "^0.0.13", "@budibase/svelte-ag-grid": "^0.0.13",
"@fortawesome/fontawesome-free": "^5.14.0", "@fortawesome/fontawesome-free": "^5.14.0",
"@svelteschool/svelte-forms": "^0.7.0",
"apexcharts": "^3.22.1", "apexcharts": "^3.22.1",
"fast-sort": "^2.2.0",
"flatpickr": "^4.6.6", "flatpickr": "^4.6.6",
"lodash.debounce": "^4.0.8", "lodash.debounce": "^4.0.8",
"quill": "^1.3.7", "quill": "^1.3.7",

View File

@ -15,7 +15,6 @@ export default {
{ {
file: "dist/index.js", file: "dist/index.js",
format: "esm", format: "esm",
name: "budibaseStandardComponents",
sourcemap: false, sourcemap: false,
}, },
], ],

View File

@ -1,138 +0,0 @@
import svelte from "rollup-plugin-svelte"
import resolve from "rollup-plugin-node-resolve"
import commonjs from "rollup-plugin-commonjs"
import livereload from "rollup-plugin-livereload"
import { terser } from "rollup-plugin-terser"
import json from "rollup-plugin-json"
const production = !process.env.ROLLUP_WATCH
const lodash_fp_exports = [
"find",
"isUndefined",
"split",
"max",
"last",
"union",
"reduce",
"isObject",
"cloneDeep",
"some",
"isArray",
"map",
"filter",
"keys",
"isFunction",
"isEmpty",
"countBy",
"join",
"includes",
"flatten",
"constant",
"first",
"intersection",
"take",
"has",
"mapValues",
"isString",
"isBoolean",
"isNull",
"isNumber",
"isObjectLike",
"isDate",
"clone",
"values",
"keyBy",
"isNaN",
"isInteger",
"toNumber",
]
const lodash_exports = [
"flow",
"head",
"find",
"each",
"tail",
"findIndex",
"startsWith",
"dropRight",
"takeRight",
"trim",
"split",
"replace",
"merge",
"assign",
]
const coreExternal = [
"lodash",
"lodash/fp",
"date-fns",
"lunr",
"safe-buffer",
"shortid",
"@nx-js/compiler-util",
"bcryptjs",
]
export default {
input: "src/Test/testMain.js",
output: {
sourcemap: true,
format: "iife",
name: "app",
file: "public/bundle.js",
globals: {
crypto: "crypto",
},
},
plugins: [
svelte({
// enable run-time checks when not in production
dev: !production,
// we'll extract any component CSS out into
// a separate file — better for performance
css: css => {
css.write("bundle.css")
},
hydratable: true,
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration —
// consult the documentation for details:
// https://github.com/rollup/rollup-plugin-commonjs
resolve({
browser: true,
dedupe: importee => {
return (
importee === "svelte" ||
importee.startsWith("svelte/") ||
coreExternal.includes(importee)
)
},
}),
commonjs({
namedExports: {
"lodash/fp": lodash_fp_exports,
lodash: lodash_exports,
shortid: ["generate"],
},
}),
json(),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!production && livereload("public"),
// If we're building for production (npm run build
// instead of npm run dev), minify
production && terser(),
],
watch: {
clearScreen: false,
},
}