Skip to content

feat(rollup): add rollup-plugin-pure support#562

Open
wotan-allfather wants to merge 1 commit intounjs:mainfrom
wotan-allfather:feat/rollup-plugin-pure-support
Open

feat(rollup): add rollup-plugin-pure support#562
wotan-allfather wants to merge 1 commit intounjs:mainfrom
wotan-allfather:feat/rollup-plugin-pure-support

Conversation

@wotan-allfather
Copy link
Copy Markdown

Adds support for rollup-plugin-pure to automatically inject /* #PURE */ annotations before specified function calls, improving tree-shaking.

Configuration:

  • Set rollup.pure to options object to enable
  • Set rollup.pure: false to explicitly disable
  • Omit to not use the plugin (default)

Example:

export default {
  rollup: {
    pure: {
      functions: ['defineComponent', 'defineStore'],
    }
  }
}

Closes #520

Adds support for rollup-plugin-pure to automatically inject /* #__PURE__ */
annotations before specified function calls, improving tree-shaking.

Configuration:
- Set `rollup.pure` to options object to enable
- Set `rollup.pure: false` to explicitly disable
- Omit to not use the plugin (default)

Example:
```ts
export default {
  rollup: {
    pure: {
      functions: ['defineComponent', 'defineStore'],
    }
  }
}
```

Closes unjs#520
@wotan-allfather wotan-allfather force-pushed the feat/rollup-plugin-pure-support branch from c886dbb to d5f1c0a Compare February 9, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rollup-plugin-pure support

1 participant