jfortunato / esbuild-plugin-manifest

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

Manifest.json key where .min added due to the esbuild outExtension config #18

Closed woodcox closed 9 months ago

woodcox commented 9 months ago

Hi, since the 1.0 version, I'm having the following issue with my keys in my manifest.json.

I configure esbuild to change the outExtension in production, for example:

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

This config results in a manfest.json which outputs as the following in a production build:

{
  "app.min": "app-6IPHY3CY.min.js",
  "style.min": "style-BO5SYYQG.min.css"
}

I need it the keys not to include .min in them. Currently I can work around this by commenting out the outExtension config. But this is not ideal. Do you have any suggestions?

jfortunato commented 9 months ago

I've just released a new version (v1.0.1) that should fix this issue. Thanks for reporting!

woodcox commented 9 months ago

Thanks so much for amending this quickly! Just updated to v1.0.1 and its working as expected. 👍