danielroe / danielroe/rollup-plugin-pure

Runs after tree-shaking

Open
#417 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
88
Forks
6
Avg merge
1d 19h
Merged PRs (30d)
7

Description

Thanks for amazing plugin.

I just found strange behavior, but don’t have experience to reproduce in other build.

In [our project](https://github.com/hplush/slowreader/), the plugin doesn’t affect JS bundle size (but change source code) until I [change calling order](https://github.com/hplush/slowreader/commit/9b4cbadafa691e93b8e704e939b537ceceb52986):

```diff
return {
+ enforce: 'pre',
name: 'rollup-plugin-pure',
transform: {
- order: 'post',
+ order: 'pre',
```

Seems like on some systems plugins runs before Vite/Rollup does static analysis for tree-shaking.

Here is our [Vite config](https://github.com/hplush/slowreader/blob/9b4cbadafa691e93b8e704e939b537ceceb52986/web/vite.config.ts).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.