budibase/packages/client/rollup.config.js

71 lines
1.8 KiB
JavaScript
Raw Normal View History

2019-09-06 14:04:23 +02:00
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import builtins from 'rollup-plugin-node-builtins';
import nodeglobals from 'rollup-plugin-node-globals';
import { terser } from 'rollup-plugin-terser';
const lodash_fp_exports = [
2019-10-18 18:32:03 +02:00
"find", "isUndefined", "split", "max",
2019-09-22 06:02:33 +02:00
"last", "union", "reduce", "isObject",
2019-09-28 06:28:11 +02:00
"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"];
2019-09-06 14:04:23 +02:00
const lodash_exports = [
2019-10-18 18:32:03 +02:00
"flow", "head", "find", "each",
2019-09-06 14:04:23 +02:00
"tail", "findIndex", "startsWith",
2019-09-28 06:28:11 +02:00
"dropRight", "takeRight",
"trim", "split", "replace",
"merge", "assign"];
2019-09-06 14:04:23 +02:00
const coreExternal = [
2019-09-28 06:28:11 +02:00
"lodash", "lodash/fp",
2019-09-06 14:04:23 +02:00
"lunr", "safe-buffer", "shortid",
"@nx-js/compiler-util"
];
export default {
input: 'src/index.js',
output: [
{
sourcemap: true,
format: 'iife',
name: 'app',
file: `./dist/budibase-client.js`
},
{
file: 'dist/budibase-client.esm.mjs',
format: 'esm',
sourcemap: "inline"
}
],
2019-09-06 14:04:23 +02:00
plugins: [
resolve({
preferBuiltins:true,
browser:true,
dedupe: importee => {
return coreExternal.includes(importee);
}
}),
commonjs({
namedExports: {
"lodash/fp": lodash_fp_exports,
"lodash":lodash_exports,
"shortid": ["generate"]
}
}),
builtins(),
nodeglobals(),
//terser()
2019-09-06 14:04:23 +02:00
],
watch: {
clearScreen: false
}
};