A Rollup/Rolldown/Vite plugin that generates .htaccess files during the build process. Current stable version is 0.13.1. Supports Apache directives with type-safe configuration via TypeScript types. The plugin integrates with Rollup (v3.29.4+), Rolldown (v1.0.0-rc7+), and Vite (v4.5.14+). Key differentiators: no runtime dependencies, comprehensive directive support, and native ESM/CJS compatibility. Requires Node >= 20. Released on npm with monthly updates.
npm install rollup-plugin-htaccessVerified import paths — ran on the pinned version, not inferred.
Example Rollup configuration using htaccess plugin to generate .htaccess with redirects, security, and caching rules.
Upgrade Node.js to version 20 or higher.
Replace `enableHTTPS: true` with `forceHTTPS: true` in your plugin config.
Use the `performance` object with `setExpires` and `setCacheControl` instead.
Use `import htaccess from 'rollup-plugin-htaccess'` or `const htaccess = (await import('rollup-plugin-htaccess')).default`.Add plugin to `plugins` in the `test` section of your vitest config.
Change your rollup config to use ESM (`.mjs` extension or `"type": "module"` in package.json) and use `import htaccess from 'rollup-plugin-htaccess'`.
Use default import: `import htaccess from 'rollup-plugin-htaccess'`.
Run `npm install --save-dev rollup-plugin-htaccess` to install the package.
No dependency data recorded yet.