SOVLOOKUP/rollup-plugin-proto(opens in a new tab)
Language: JavaScript
A Rollup plugin which Convert proto files to ES6 modules
- stars
- 0
- watchers
- 0
- forks
- 0
- open issues
- 0
- Last updated
- 12/15/2023
Language: JavaScript
A Rollup plugin which Convert proto files to ES6 modules
🍣 A Rollup plugin which Convert grpc .proto files to ES6 modules of loaded grpc object.
This plugin requires an LTS Node version (v8.0.0+) and Rollup v1.20.0+.
Using npm:
npm install rollup-plugin-gproto --save-devCreate a rollup.config.js configuration file and import the plugin:
import proto from 'rollup-plugin-gproto'; export default { input: 'src/index.js', output: { dir: 'output', format: 'cjs' }, plugins: [proto()] };
Then call rollup either via the CLI or the API.
With an accompanying file src/index.js, the local package.json file would now be importable as seen below:
// src/index.js import proto from './hello.proto'; console.log(proto);
Type: Boolean
Default: false
If true, instructs the plugin to ignore indent and generates the smallest code.
Type: String | Array[...String]
Default: null
A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore. By default no files are ignored.
Type: String | Array[...String]
Default: null
A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.
Type: String
Default: '\t'
Specifies the indentation for the generated default export.
Type: Boolean
Default: true
If true, instructs the plugin to generate a named export for every property of the JSON object.
Type: Boolean
Default: false
If true, instructs the plugin to declare properties as variables, using either var or const. This pertains to tree-shaking.