Update string-templates to use a better node polyfill rollup plugin

This commit is contained in:
Andrew Kingston 2021-03-31 19:07:09 +01:00
parent aa450c08b4
commit 6dae8a83ec
2 changed files with 16 additions and 17 deletions

View File

@ -2,7 +2,7 @@
"name": "@budibase/string-templates",
"version": "0.8.9",
"description": "Handlebars wrapper for Budibase templating.",
"main": "dist/bundle.cjs",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",
"license": "AGPL-3.0",
"types": "dist/index.d.ts",
@ -32,9 +32,8 @@
"jest": "^26.6.3",
"marked": "^2.0.0",
"rollup": "^2.36.2",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-polyfill-node": "^0.6.2",
"rollup-plugin-terser": "^7.0.2",
"typescript": "^4.1.3"
},

View File

@ -2,8 +2,7 @@ import commonjs from "@rollup/plugin-commonjs"
import resolve from "rollup-plugin-node-resolve"
import json from "@rollup/plugin-json"
import { terser } from "rollup-plugin-terser"
import builtins from "rollup-plugin-node-builtins"
import globals from "rollup-plugin-node-globals"
import polyfillNode from "rollup-plugin-polyfill-node"
const production = !process.env.ROLLUP_WATCH
@ -13,8 +12,7 @@ const plugins = [
preferBuiltins: true,
}),
commonjs(),
builtins(),
globals(),
polyfillNode(),
production && terser(),
json(),
]
@ -29,14 +27,16 @@ export default [
},
plugins,
},
{
input: "src/index.cjs",
output: {
sourcemap: !production,
format: "cjs",
file: "./dist/bundle.cjs",
exports: "named",
},
plugins,
},
// This is the valid configuration for a CommonJS bundle, but since we have
// no use for this, it's better to leave it out.
// {
// input: "src/index.cjs",
// output: {
// sourcemap: !production,
// format: "cjs",
// file: "./dist/bundle.cjs",
// exports: "named",
// },
// plugins,
// },
]