Tools: Question: Tree Shaking?

Created on 17 May 2018  路  4Comments  路  Source: Polymer/tools

Do you see tree shaking as being something that would make the roadmap for the polymer build command at any point or is this another benefit I can get from the move to ESmodules, the ability to apply a different tool to this?

Very excited about the new changed. Keep up the great work!

Most helpful comment

Any plan on that? Should I create another issue with a feature request?

I see this is currently explicitly disabled in the config. I can imagine there were multiple reasons to disable it, but I didn't find any evidence on why such a decision was made by the Polymer team.

Also I believe this might be exposed as an option in polymer.json for people who want to activate it in environments where they are more sure their code will be built without an issue. What do you think, folks?

All 4 comments

Any plan on that? Should I create another issue with a feature request?

I see this is currently explicitly disabled in the config. I can imagine there were multiple reasons to disable it, but I didn't find any evidence on why such a decision was made by the Polymer team.

Also I believe this might be exposed as an option in polymer.json for people who want to activate it in environments where they are more sure their code will be built without an issue. What do you think, folks?

I like where you're coming from @bashmish. Maybe a more productive question is, given the other issues in tools that @frankiefu mentioned when referencing this in the PWA Starter Kit PR, if a PR were to arrive in this repo that supported making the treeshake setting customizable via polymer.json is that something that would be appreciated by the team? As part of moving my code to over to lit-element I've gotten a bit file size crazy and would be happy to dive back into the code here to knit something like:

"builds": [
    {
        "treeshaking": <Boolean | Object> default to false
    }
]

To support the options available in Rollup regarding treeshaking: https://rollupjs.org/guide/en#treeshake-treeshake-no-treeshake My TypeScript is a work in progress, but this would seem like a very useful place to continue its development...

I guess this is now available: https://github.com/Polymer/tools/pull/3367

Indeed. Closing!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dilansankalpa picture dilansankalpa  路  3Comments

lpellegr picture lpellegr  路  4Comments

rwatts3 picture rwatts3  路  3Comments

pmaudsley picture pmaudsley  路  3Comments

priyabrat1801 picture priyabrat1801  路  3Comments