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

marcosguti picture marcosguti  路  3Comments

SabirAmeen picture SabirAmeen  路  3Comments

k15a picture k15a  路  3Comments

youngwind picture youngwind  路  3Comments

jasongerbes picture jasongerbes  路  3Comments