Skip to content

Conversation

@remcohaszing
Copy link

@remcohaszing remcohaszing commented Aug 19, 2023

The Node.js path module can be imported with named exports when using ESM. path-browserify could not. All exports were rewritten to use exports.name = value. This allows to use named imports. As a bonus this probably also provides better tree shaking.

This affects Node.js 12 and upwards. However, CI is configured to run against Node.js up to 10. So I didn’t add tests.

The Node.js `path` module can be imported with named exports when using
ESM. `path-browserify` could not. All exports were rewritten to use
`exports.name = value`. This allows to use named imports.
@remcohaszing
Copy link
Author

Note that this changed indentation of a major part of the file. It’s best reviewed with whitespace changes hidden.

@valerii15298
Copy link

@remcohaszing do you consider forking it and publishing with this change? It seems that when using monaco-yaml the problem with module is not defined is because of this package on which monaco-yaml depends. I just got it from my error logs, this repo does not seem to be maintained for 5+ years...

ping @goto-bus-stop
@devongovett @juliangruber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants