Rollup plugin & config generator for CPUchain TypeScript projects
From rollup.config.js
import { getRollupConfig } from '@cpuchain/rollup'
const config = [
// Builds mjs and cjs for node by default
getRollupConfig({ input: './src/index.ts' }),
getRollupConfig({ input: './src/typesWorker.ts' }),
// For browser files
getConfig({
input: './src/index.ts',
// window.TSLibrary
browserName: 'TSLibrary',
globals: {
jQuery: '$',
ethers: 'ethers'
},
// Do not forget to include globals as external otherwise they will be bundled
external: ['crypto', 'ethers'],
// Minification is optional and not minified by default
minify: true,
}),
]
export default config;And run tsc -p tsconfig.types.json --noEmit && rollup -c to test types and generate bundled entry files (including d.ts)