fix: broken webpack mangling of harmony imports in production mode #223
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is an issue when bundling code with imported aurelia dependency via harmony import. The code like:
import { ConsoleAppender } from 'aurelia-logging-console'
console.log(ConsoleAppender)
bundles into something like:
var a=r("aurelia-logging-console")
console.log(a.A)
while aurelia-logging-console isn't mangled itself to match the export names, so i.I is undefined.
This fix seem to work for all such cases but I am not sure if the original approach was written in such way for some specific cases which I might not be aware of so better to be investigated by core team.There is an issue when bundling code with imported aurelia dependency via harmony import. The code like:
import { ConsoleAppender } from 'aurelia-logging-console'
console.log(ConsoleAppender)
bundles into something like:
var a=r("aurelia-logging-console")
console.log(a.A)
while aurelia-logging-console isn't mangled itself to match the export names, so i.I is undefined.
This fix seem to work for all such cases but I am not sure if the original approach was written in such way for some specific cases which I might not be aware of so better to be investigated by core team.
Credits to @alexander-akait for pointing this out!