danielroe / siroc

Zero-config build tooling for Node
MIT License
152 stars 4 forks source link

fix: nested export conditions not supported #222

Open pi0 opened 3 years ago

pi0 commented 3 years ago

🐛 The bug What isn't working? Describe what the bug is.

🛠️ To reproduce

package.json: (trying on ohmyfetch)

  "exports": {
    ".": {
      "node": {
        "import": "./dist/node.mjs",
        "require": "./dist/node.js"
      },
      "default": {
        "import": "./dist/index.mjs",
        "require": "./dist/index.js"
      }
    },
    "./node": {
      "import": "./dist/node.mjs",
      "require": "./dist/node.js"
    }
  }

Output:

 ERROR  path.startsWith is not a function                                                                                                                                                                                                                                                      16:56:11

  at getEntrypointFilenames (node_modules/siroc/bin/cli.js:170:12)
  at Package.resolveEntrypoint (node_modules/siroc/bin/cli.js:485:23)
  at node_modules/siroc/bin/cli.js:736:43
  at Array.map (<anonymous>)
  at getRollupConfig (node_modules/siroc/bin/cli.js:736:27)
  at node_modules/siroc/bin/cli.js:866:24
  at Generator.next (<anonymous>)
  at fulfilled (node_modules/siroc/bin/cli.js:824:24)