# rollup-esm-template

> Building a tree shaking package using rollup.

Latest version **1.0.3** (published 2021-12-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-esm-template
pnpm add rollup-esm-template
yarn add rollup-esm-template
bun add rollup-esm-template
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-12-02 |
| First published | 2021-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jack |
| Maintainers | jackiechen |

## Links

- npm: https://www.npmjs.com/package/rollup-esm-template
- Repository: https://github.com/chen86860/rollup-esm-template
- Homepage: https://github.com/chen86860/rollup-esm-template#readme
- Issues: https://github.com/chen86860/rollup-esm-template/issues
- npm.io page: https://npm.io/package/rollup-esm-template

## Dependencies (1)

- [dayjs](https://npm.io/package/dayjs.md) ^1.10.7

## Recent versions

- 1.0.3 (latest) — 2021-12-02

## README

# rollup-esm-template

Building a tree shaking package using rollup.

## Requirements

1. Set a `slideEffect: false` flag in `package.json`

```json
    "sideEffects": false,
```

2. Make all export to input
3. Setting output to `esm`

```js
export default {
  input: ["src/*.ts"],
  output: {
    dir: pkg.module,
    format: "esm",
  },
  plugins: [commonjs(), typescript(), resolve(), multiInput()],
};
```

4. Build it!

## Usage

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

foo();
```

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

---
_Source: https://npm.io/package/rollup-esm-template · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
