Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path posix reference #33

Open
CMCDragonkai opened this issue Aug 28, 2017 · 0 comments
Open

Path posix reference #33

CMCDragonkai opened this issue Aug 28, 2017 · 0 comments

Comments

@CMCDragonkai
Copy link

CMCDragonkai commented Aug 28, 2017

The Nodejs path module has a posix property that explicitly forces the utilisation of the posix version of the path functions (this is important when developing unix apps on windows). Since this plugin supplies the join in posix form, I believe there should be a circular reference of path.posix that points back to itself. The currently generated code shows this:

var path = {
   extname: extname,
   basename: basename,
   dirname: dirname,
   sep: sep,
   delimiter: delimiter,
   relative: relative,
   join: join,
   isAbsolute: isAbsolute,
   normalize: normalize,
   resolve: resolve
 };

There should be one more property called posix that points back to path. I'm not sure how that's done in Node, perhaps they point back to the path module?

opichals added a commit to opichals/EspruinoTools that referenced this issue Mar 1, 2020
Based on calvinmetcalf/rollup-plugin-node-builtins#33

Another way of solving that is using the following patch:

```
--- node_modules/rollup-plugin-node-builtins/src/es6/path.js
+export var posix = {
+  relative: relative,
+  join: join,
+  isAbsolute: isAbsolute,
+  normalize: normalize,
+  resolve: resolve
+};
 export default {
```
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

No branches or pull requests

1 participant