electerious / basicLightbox

The lightest lightbox ever made.

Home Page:https://basiclightbox.electerious.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

change npm main to src

jimblue opened this issue Β· comments

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

Hi @electerious !

Any news about this?

Thanks man

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.

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 ! πŸ˜‰

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.

@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.

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! :)

'right @electerious, no worries about this. πŸ˜„