calvinmetcalf / rollup-plugin-node-builtins

138 stars 40 forks source link

Path posix reference #33

Open CMCDragonkai opened 7 years ago

CMCDragonkai commented 7 years ago

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?