{"library":"rollup-plugin-pure","title":"rollup-plugin-pure","description":"Rollup/Vite plugin that automatically injects /*#__PURE__*/ annotations before specific function calls and /*@__NO_SIDE_EFFECTS__*/ before function declarations, enabling better tree-shaking for libraries with definition functions like Vue's defineComponent. Current stable version is 0.4.0, actively maintained. Supports regex function names, uses AST-based approach, and handles Rollup's awareness of pure annotations. Key differentiator: automatic annotation injection without manual marks, works with Vite and Rollup 3/4.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-pure"],"cli":null},"imports":["import { PluginPure } from 'rollup-plugin-pure'","import { PluginPure as rollupPluginPure } from 'rollup-plugin-pure'","import type { PluginPure } from 'rollup-plugin-pure'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// vite.config.ts\nimport { PluginPure } from 'rollup-plugin-pure';\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n  plugins: [\n    PluginPure({\n      functions: ['defineComponent', /^define(Page|Meta)$/],\n      include: [/(?<!im)pure\\.js$/],\n      // exclude: [],\n      // sourcemap: true,\n    }),\n  ],\n});","lang":"typescript","description":"Configures Vite to annotate defineComponent and regex-matched functions as pure, targeting files ending with 'pure.js' except those starting with 'im'.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}