Given this situation...
// main.js
import Foo from './Foo';
var foo = new Foo();
var baz = new Foo.Baz();
// Foo.js
import { Bar } from './Bar';
import { Baz } from './Baz';
Bar.Baz = Baz; // this statement is ignored
export default Bar;
// Bar.js
export function Bar () {
alert( 'bar' );
}
// Baz.js
export function Baz () {
alert('baz');
}
...we'd expect Foo to have a Baz property, but Rollup goes straight to the original Foo definition, ignoring the Bar.Baz = Baz line:
function Bar () {
alert( 'bar' );
}
var Foo = Bar;
var foo = new Foo();
var baz = new Foo.Baz();
We need to catch any statements that mutate imported bindings, wherever they are.
Given this situation...
...we'd expect
Footo have aBazproperty, but Rollup goes straight to the originalFoodefinition, ignoring theBar.Baz = Bazline:We need to catch any statements that mutate imported bindings, wherever they are.