proto: fix proto generation, tsc: fix node imports of compiled code
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
yarn pbjs -t static-module -w es6 --no-bundle -o ./WAProto/index.js ./WAProto/WAProto.proto;
|
||||
yarn pbts -o ./WAProto/index.d.ts ./WAProto/index.js;
|
||||
yarn pbjs -t static-module -w es6 --no-bundle -o ./index.js ./WAProto.proto;
|
||||
yarn pbts -o ./index.d.ts ./index.js;
|
||||
node ./fix-imports.js
|
||||
|
||||
@@ -13,6 +13,12 @@ try {
|
||||
'import $1 from'
|
||||
);
|
||||
|
||||
// add missing extension to the import
|
||||
content = content.replace(
|
||||
/(['"])protobufjs\/minimal(['"])/g,
|
||||
'$1protobufjs/minimal.js$2'
|
||||
);
|
||||
|
||||
// Write back
|
||||
writeFileSync(filePath, content, 'utf8');
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
|
||||
import $protobuf from "protobufjs/minimal";
|
||||
import $protobuf from "protobufjs/minimal.js";
|
||||
|
||||
// Common aliases
|
||||
const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
|
||||
|
||||
Reference in New Issue
Block a user