protobuf-ts icon indicating copy to clipboard operation
protobuf-ts copied to clipboard

Add plugin option to add `.js` at end of imports

Open Levyks opened this issue 6 months ago • 1 comments

Currently, protobuf-ts create files with imports like this:

// @generated by protobuf-ts 2.9.4
// @generated from protobuf file "connection_handler.proto" (package "myapp.connection_handler", syntax proto3)
// tslint:disable
import { Empty } from "./common";

However, when using type: "module" and depending on your tsconfig, you're forced to put the .js extension for it to work, would it be possible to add an option to the plugin to generate it like this?

// @generated by protobuf-ts 2.9.4
// @generated from protobuf file "connection_handler.proto" (package "myapp.connection_handler", syntax proto3)
// tslint:disable
import { Empty } from "./common.js";

Levyks avatar Aug 25 '24 20:08 Levyks