https://github.com/alorel/rollup-plugin-manifest-json
Rollup plugin for generating a manifest.json
https://github.com/alorel/rollup-plugin-manifest-json
Last synced: 29 days ago
JSON representation
Rollup plugin for generating a manifest.json
- Host: GitHub
- URL: https://github.com/alorel/rollup-plugin-manifest-json
- Owner: Alorel
- License: mit
- Created: 2020-06-21T14:45:40.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-27T15:50:14.000Z (about 4 years ago)
- Last Synced: 2025-02-04T15:25:25.815Z (3 months ago)
- Language: TypeScript
- Size: 1.65 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Rollup plugin for generating a manifest.json.
Overall it just copies over a json file and replaces any relative
URLs in icons and screenshots with emitted asset links.# Installation
[Configure npm for GitHub packages](https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages)
then install `@alorel/rollup-plugin-manifest-json`# Example
```javascript
import {manifestJsonPlugin} from '@alorel/rollup-plugin-manifest-json';
import {join} from 'path';export default {
...stuff,
plugins: [
manifestJsonPlugin({
input: join(__dirname, 'src', 'manifest.json'),
fileName: 'manifest.json'
})
]
}
```# Options
```typescript
interface Base {
/**
* Base directory to resolve URLs from
* @default process.cwd()
*/
baseDir?: string;
/**
* Your public path
* @default /
*/
basePath?: string;
/** Output file name */
fileName: string;
/** Manifest.json input file */
input: string;/**
* Array of regular expression search patterns & replacements. Effectively does
* manifestJsonContents.replace(reg, string);
*/
replace?: [[RegExp | string, string]];
/**
* Whether to minify the output or not
* @default true
*/
minify?: boolean;
/**
* Whether to watch the input file for changes.
* false makes this function as an output plugin
* true makes this function as a plugin
* @default false
*/
watch?: boolean;
}
```