Skip to content

cpuchain/rollup

Repository files navigation

@cpuchain/rollup

NPM Version Statements

Rollup plugin & config generator for CPUchain TypeScript projects

How to use it?

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)

About

Rollup plugin & config generator for CPUchain TypeScript projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •