Preact: Pure module

Created on 3 Aug 2017  路  3Comments  路  Source: preactjs/preact

I might be off here, but I think that preact does qualify as a pure module by webpack's definition, correct? If so, I'd be happy to PR this property to the package.json file, I'm sure this would be a nice benefit when compressing with webpack 馃榿

discussion

Most helpful comment

I don't think it's applicable to Preact. As I can see the only _optional_ sub-module is cloneElement (https://github.com/developit/preact/blob/master/src/preact.js#L2) and it isn't big at all. In my opinion, it just doesn't worth it.

Btw, now it's "side-effects": https://github.com/webpack/webpack/tree/next/examples/side-effects

All 3 comments

Not sure if I'm reading the docs correctly, but preact doesn't re-export anything (since it has no dependencies).

If you're reexporting parts of your own package from the top level, this would allow someone to import just one thing and have the others get tree-shaken out. I'm not sure if this is the case with preact, just pointing out that it has nothing to do with package dependencies, only modules.

I don't think it's applicable to Preact. As I can see the only _optional_ sub-module is cloneElement (https://github.com/developit/preact/blob/master/src/preact.js#L2) and it isn't big at all. In my opinion, it just doesn't worth it.

Btw, now it's "side-effects": https://github.com/webpack/webpack/tree/next/examples/side-effects

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kay-is picture kay-is  路  3Comments

nopantsmonkey picture nopantsmonkey  路  3Comments

jasongerbes picture jasongerbes  路  3Comments

adriaanwm picture adriaanwm  路  3Comments

philipwalton picture philipwalton  路  3Comments