Closed IanVS closed 2 years ago
Hey Ian,
Thanks for letting me know!
Actually, I've just come back to this project after about a year and it wasn't easy to find that information.
I outline all the options here:
I'm not sure why, but it's not easy to find if you just come to GitHub!
I'll see what I can do about that now.
Cheers, Dave
Thanks, I see two issues:
1) the array format produces incorrect keys for rollup 2) the docs indicate that object is the default format, but it is not, array is the default.
I'd be happy to submit a PR if you like.
I've just spent some time looking into this, didn't quite understand what you're alluding to, but I think I finally got there.
The problem is here:
https://github.com/davestewart/alias-hq/blob/master/src/plugins/rollup/index.js#L9
The merging of defaults should actually be done here:
https://github.com/davestewart/alias-hq/blob/master/src/plugins/rollup/index.js#L29
Otherwise, if you skip passing options, the main function returns the array format – as you said.
Thanks for flagging! I'll get this fixed up and published in the next hour or so.
OK, looking good:
About to publish.
This seems like a very cool tool, and I'm getting started using it, but having some trouble with rollup.
I'm building my app with vite, which allows a
resolve.alias
setting (https://vitejs.dev/config/#resolve-alias) that is passed to @rollup/plugin-alias. However, when I runhq.get('rollup')
, I get an array like this:But rollup wants the objects to have keys of
find
andreplacement
. Debugging via the cli results in the right thing, just nothq.get()
. Am I doing something incorrectly? Thanks!Edit: I just found that
hq.get('rollup', { format: 'object' })
will meet my needs, but I'll leave this open in case you'd like to look into it.