Rollup: Incorrectly removing code

Created on 6 Sep 2016  Â·  3Comments  Â·  Source: rollup/rollup

bool.js:

export default true

index.js:

import bool from "./bool"

const hs = document.documentElement.style

if (bool) {
    hs.color = "#222"
}

console.log("hey")

command:

rollup index.js

output:

console.log("hey")

😢

Most helpful comment

Thanks – this will be fixed by #902

All 3 comments

@azdavis The real mystery is why does it work with a log within the predicate block? ¯_(ツ)_/¯
capture d ecran 2016-09-06 a 04 54 48

Thanks – this will be fixed by #902

@Rich-Harris you ALWAYS come through bruh!

Was this page helpful?
0 / 5 - 0 ratings