metadevpro / ts-pegjs

Plugin for pegjs to generate TypeScript parsers.
MIT License
151 stars 32 forks source link

Convert new peggy `--dependencies` or `--dependency` into TypeScript imports #90

Closed zm-cttae-archive closed 1 year ago

zm-cttae-archive commented 1 year ago

Peggy supports --dependencies and --dependency per documentation. Would like to have these evaluated as an import. Would be beneficial for TypeScript, Webpack and many other dependencies.

It's possible to implement this by a text replacement. The output looks like let matchers = require('matchers');

pjmolina commented 1 year ago

It is a nice feature to add. If you want to make a PR, please feel free to propose.

zm-cttae-archive commented 1 year ago

Figured this out without a output regex :)

pjmolina commented 1 year ago

Published on v. ts-pegjs@3.1.0

zm-cttae-archive commented 1 year ago