update to Rollup 3

This commit is contained in:
Conduitry 2022-12-12 10:35:17 -05:00
parent 9b78e1687e
commit c9f7dcdbbd
2 changed files with 17 additions and 6 deletions

View File

@ -38,13 +38,13 @@
"homepage": "https://conduitry.dev/defiler",
"devDependencies": {
"@types/node": "=12",
"rollup": "^2",
"rollup": "^3",
"rollup-plugin-cheap-ts": "Conduitry/rollup-plugin-cheap-ts#semver:^1",
"typescript": "^4"
},
"scripts": {
"build": "rollup -c",
"dev": "rollup -cw",
"build": "rollup -c --bundleConfigAsCjs",
"dev": "rollup -cw --bundleConfigAsCjs",
"prepare": "npm run build"
}
}

View File

@ -2,10 +2,21 @@ import cheap_ts from 'rollup-plugin-cheap-ts';
export default {
input: './src/index',
external: name => /^[a-z]/.test(name),
external: (name) => /^[a-z]/.test(name),
plugins: [cheap_ts()],
output: [
{ file: './dist/index.cjs', format: 'cjs', sourcemap: true, interop: false, preferConst: true },
{ file: './dist/index.mjs', format: 'esm', sourcemap: true, preferConst: true },
{
file: './dist/index.cjs',
format: 'cjs',
sourcemap: true,
interop: 'esModule',
generatedCode: { constBindings: true },
},
{
file: './dist/index.mjs',
format: 'esm',
sourcemap: true,
generatedCode: { constBindings: true },
},
],
};