rollup-esm-template

1.0.3 • Public • Published

rollup-esm-template

Building a tree shaking package using rollup.

Requirements

  1. Set a slideEffect: false flag in package.json
    "sideEffects": false,
  1. Make all export to input
  2. Setting output to esm
export default {
  input: ["src/*.ts"],
  output: {
    dir: pkg.module,
    format: "esm",
  },
  plugins: [commonjs(), typescript(), resolve(), multiInput()],
};
  1. Build it!

Usage

import { foo } from "rollup-esm-template";

foo();

For that, the bar function in rollup-esm-template will not build into bundle by tree shaking.

Readme

Keywords

none

Package Sidebar

Install

npm i rollup-esm-template

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

9.31 kB

Total Files

6

Last publish

Collaborators

  • jackiechen