electerious / basicLightbox

The lightest lightbox ever made.
https://basiclightbox.electerious.com
MIT License
564 stars 55 forks source link

change npm main to src #9

Closed jimblue closed 6 years ago

jimblue commented 7 years ago

Hi again @electerious,

I'm apparently the only one around haha 😄 !

I was wondering if it's possible to change the main entry inside packages.json. Actually it's pointing to the minified version of basicLightbox which is not good when building.

It should be better to change it for the the source version: src/script/main.js.

Thank you so much

jimblue commented 7 years ago

Hi @electerious !

Any news about this?

Thanks man

electerious commented 7 years ago

Hey @jimblue how are other browser modules doing it?

I think it won't make a huge difference for a bundle at this size. Maybe we could add the untranspiled version as "esnext" in the package.json.

It's also a default browserify behavior not to transpile files required from node_modules. This change may require others (including me) to change their bundling workflow.

jimblue commented 7 years ago

Hi @electerious !

Indeed you're lib is so light, it's not about size.

It's to avoid potential problem that happen sometime when concatenating and minify different sources, some already minify other not.

Webpack donc have the same default behaviour. Also for performance and optimisation it's better to minify everything from source.

And no worries if you prefer keep the actual behaviour, I will survive ! 😉

electerious commented 7 years ago

Is the "esnext" option in the package.json something that would help you? I think it's a fine solution for the current state of JS modules.

jimblue commented 7 years ago

@Hi @electerious !

I didn't knew this option, but honestly I don't like it 😄 Again something to add to webpack...

And I assume peoples using npm are peoples who bundle. That's why main package.json should always be the source...

But that's just my opinion, I will just specify the src path on import.

electerious commented 6 years ago

I will stay with the current implementation because it would break my own workflow. But I will keep it in mind and might adjust it one day. Thanks for the suggestion! :)

jimblue commented 6 years ago

'right @electerious, no worries about this. 😄