It looks like the tree-shaking is not supporting this scenario:
const defaultGreeting = 'Hello';
const defaultName = 'World';
export function greet(opts) {
const {
greeting = defaultGreeting,
name = defaultName
} = opts;
console.log(greeting + ' ' + name);
}
Rollup produces:
function greet(opts) {
const {
greeting = defaultGreeting,
name = defaultName
} = opts;
console.log(greeting + ' ' + name);
}
Note that defaultGreeting and defaultName are referenced in the code, but not defined anywhere.
Is there a way to disable tree shaking for now?
It looks like the tree-shaking is not supporting this scenario:
Rollup produces:
Note that
defaultGreetinganddefaultNameare referenced in the code, but not defined anywhere.Is there a way to disable tree shaking for now?