jfortunato / esbuild-plugin-manifest

Esbuild plugin for building an asset manifest file.
MIT License
31 stars 5 forks source link

Manifest.json key error if source maps = true and extensionless = input #20

Closed woodcox closed 8 months ago

woodcox commented 8 months ago

Hi, the error you fixed with the 1.0.1 version, has resulted in another error when source maps are set to true in the esbuild config and the manifest plugin is configured with extensionless: 'input'.

For example:

const esbuildOpts = {
  sourcemap: true,
  // other config...
  plugins:[ 
    manifestPlugin({
      hash: isProd ? '[name]-[hash]' : '[name]',
      shortNames: true,
      extensionless: 'input'
    }),
  // more config ...
  ]
}

This config results in an error message in the terminal:

[ERROR] There is a conflicting manifest key for 'app'. First conflicting output: 'app.js.map'. Second conflicting output: 'app.js'. [plugin manifest].

I believe this is because there cannot be two app keys for app.js.map and the app.js in the manifest.json. To resolve this you could append .map to the key when the value ends in .map?

jfortunato commented 8 months ago

Should be fixed with v1.0.2

woodcox commented 8 months ago

Great, thanks again for updating so quickly. That's fixed the issue.