Back to results
GitaiQAQ/rollup-plugin-output(opens in a new tab)
Language: TypeScript
Custom output format for rollup.
- stars
- 3
- watchers
- 0
- forks
- 1
- open issues
- 0
- Last updated
- 12/01/2019
Language: TypeScript
Custom output format for rollup.
Custom output format for rollup.
$ npm install --save-dev rollup-plugin-output
Or
$ yarn add -D rollup-plugin-output
// src/manifest.ts import * as pkg from "../package.json"; export default { name: pkg.name, description: pkg.description, version: pkg.version, app: { background: { scripts: ["background.js"] } } };
// rollup.config.js import json from "rollup-plugin-json"; import output from "rollup-plugin-output"; const manifest = { input: "src/manifest.ts", output: { file: "dist/manifest.json", format: "json" }, plugins: [json(), output()] }; export default [manifest];
// dist/manifest.json { "name": "shadowsocks-chromeos", "description": "", "version": "1.0.0", "app": { "background": { "scripts": [ "background.js" ] } } }
// rollup.config.js const manifest = { input: "src/manifest.ts", output: { file: "dist/manifest.txt", format (code) { return "Hello World"; } }, plugins: [json(), output()] };
// dist/manifest.txt Hello World