Renaming destruction imports are not working in v4.0-beta.5 :
<import { client: twilio } from '../../lib/twilio.js' />
results in compilation error, while
<script template-helpers>
const { client: twilio } = require('../../lib/twilio.js');
</script>
works fine...
I agree that this should be supported.
But you can use as for aliases:
import { client as twilio } from '../../lib/twilio'
Sorry, my fault, I forgot ES6 syntax while doing refactoring for <import> from require. Thank you!
I wrote up a fix to support colon destructuring as it's supported in standard JS destructuring. I actually didn't know that colon destructuring is not supported in import destructuring, which I find quite surprising and inconsistent. I rejected my PR. This issue should be closed. /cc @patrick-steele-idem
We want to strictly follow the ES6 import syntax. Closing this issue. Thanks.
Most helpful comment
But you can use
asfor aliases: