0.1.0 • Published 2 years ago
bun-plugin-proto v0.1.0
bun-plugin-proto
Adds support for .proto imports in Bun.
Installation
bun add bun-plugin-proto -dBundler usage
import proto from "bun-plugin-proto";
Bun.build({
// other config
plugins: [
proto()
],
});In your sources you can now import proto files
import packageDefinition from './file.proto'
console.log(packageDefinition)The contents of the packageDefinition will be inlined into your bundle.
Runtime usage
To use as a runtime plugin, create a file that registers the plugin:
// proto.ts
import proto from 'bun-plugin-proto'
Bun.plugin(proto({}));Then preload it in your bunfig.toml:
preload = ['./proto.ts']License
MIT
0.1.0
2 years ago