1.0.3 • Published 2 years ago

rollup-esm-template v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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.