unic / estatico

[DEPRECATED] Estático – Static site generator for frontend unicorns
Other
121 stars 18 forks source link

replaced the full import of lodash with the import of 2 single functions #63

Closed swey closed 7 years ago

swey commented 7 years ago

replaced the full import of lodash with the import of 2 single functions (reduces the file size a lot)

-> saves around 75kb minified (around 25kb gzipped)

backflip commented 7 years ago

Would it make sense to use the same syntax for https://github.com/unic/estatico/blob/edee846916e696ccb7ff1a03972da9d35ff189ba/source/assets/js/helpers/events.js#L2 and remove the explicit dependencies on lodash.XY?

swey commented 7 years ago

@backflip Yes, removing two npm packages and use the main lodash package for all things is a very good idea 👍

orioltf commented 7 years ago

Shouldn't we be having lodash declared then as a dependency? I see it is declared as a dev dependency, but it is also used in the client side, so I'd expect to have it declared in the "dependencies" section in package.json. Or am I wrong @swey @backflip @marbor3 ?

swey commented 7 years ago

The lodash functionality still will be included in the main.js like every other library. The only change in this PR is that we don't fully include lodash anymore. So I don't see a reason to move the dependency.