Closed XenoS-ITA closed 4 months ago
I don't think we can change the default format in the API; that would break existing code.
you are totally right, it could be done with the next big version also because the fact that the CLI has commonjs
as default and the API as bare
does not makes not too much logical sense (in my opinion)
Let's fix this, and we can then open another issue to revisit the default at the next breaking change.
I'm not going to cut a release just for this, since there is a work-around.
When trying to compile a file with peggy if you set the format to bare the import is simply ignored with no warning indicating that bare cannot import
Step to reproduce:
npx peggy path/to/file.peggy --format bare
)What should come out: An error or warning that the import was ignored. Maybe for the api change the default format to
commonjs
or throw an error