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

Incorrect import path for output entries in metadata #549

Closed
evanleck opened this issue Nov 19, 2020 · 0 comments
Closed

Incorrect import path for output entries in metadata #549

evanleck opened this issue Nov 19, 2020 · 0 comments

Comments

@evanleck
Copy link

When writing out a metadata file, the imports -> path fields are wrong and appear to have doubled the --public-path value. Seems like this may be related to #524, but either way I've put together a reproduction repository. Pull that down, run npm install and then this command (it's also in the repro repo):

npx esbuild --metafile=meta.json --public-path=assets --bundle --format=esm --splitting --outdir=assets index.js other.js

And take a look at the metafile's contents. You'll see that each outputs entry's imports path look like assets/assets/chunk* where it should only include assets once.

{
  "inputs": {
    "index.js": {
      "bytes": 46,
      "imports": [
        {
          "path": "log.js"
        }
      ]
    },
    "log.js": {
      "bytes": 54,
      "imports": []
    },
    "other.js": {
      "bytes": 44,
      "imports": [
        {
          "path": "log.js"
        }
      ]
    }
  },
  "outputs": {
    "assets/index.js": {
      "imports": [
        {
          "path": "assets/assets/chunk.STFGGPZ3.js"
        }
      ],
      "exports": [],
      "inputs": {
        "index.js": {
          "bytesInOutput": 16
        }
      },
      "bytes": 79
    },
    "assets/other.js": {
      "imports": [
        {
          "path": "assets/assets/chunk.STFGGPZ3.js"
        }
      ],
      "exports": [],
      "inputs": {
        "other.js": {
          "bytesInOutput": 14
        }
      },
      "bytes": 77
    },
    "assets/chunk.STFGGPZ3.js": {
      "imports": [],
      "exports": [
        "log"
      ],
      "inputs": {
        "log.js": {
          "bytesInOutput": 50
        }
      },
      "bytes": 79
    }
  }
}
@evanw evanw closed this as completed in 112c06d Nov 20, 2020
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