babel-plugin-transform-assets
babel-plugin-transform-assets copied to clipboard
Fix importing files from within dependencies (e.g. in node_modules)
Use require.resolve with paths to fix importing files from within dependencies (e.g. in node_modules)
Thanks! Can you get rid of the update to node engine?
#7 should fix that for everyone that uses even an older version of node.
require.resolve paths option isn't available until 8.9 which is why I changed the engine
Current LTS is 8.11.3. And other people seem to still be using even older versions. So not sure how to best achieve this without having to bump up the engine version. We could probably check node version at runtime and fallback to path.resolve
for older versions. What do you think?
8.11.3 is after 8.9 though - are you suggesting that if we do bump the engine version it should be to 8.11.3?
It might be best to do a major release of the plugin with the engine bump so people can continue to use the old version if they can't upgrade Node?
We could do a fallback as you suggest but I'm concerned people will continue to use old versions of Node without awareness of this caveat.
Perhaps it might be best to do a major release with the change and deprecate the old versions on NPM?
I was suggesting we check if nodeVersion >= 8.9
at runtime and use require.resolve
with fallback to resolve
on older versions to keep it backward compatible. Something like:
let r = nodeVersion >= '8.9' ? require.resolve : resolve;
But yeah, let's do a v2 release so people who rely on older node can continue using v1.