Skip to content

Conversation

@oskarer
Copy link

@oskarer oskarer commented Nov 29, 2022

Minifying a package published on NPM is generally not needed. The project that installs the package usually has a minifier that takes care of that.

Advantages of not minifying;

@neSpecc
Copy link
Member

neSpecc commented Feb 17, 2023

What about bundling for CDN?

@gkovats
Copy link

gkovats commented Feb 21, 2023

I like this, though it kinda goes against all the tools that are all minified. Honestly would be fine if they generated a source map for all builds rather than just development.

It enhances debugging for package consumers
@oskarer
Copy link
Author

oskarer commented Feb 24, 2023

What about bundling for CDN?

@neSpecc It is not needed to minify, jsdelivr.com does it for you when you request it. From https://www.jsdelivr.com/documentation:
image

I like this, though it kinda goes against all the tools that are all minified. Honestly would be fine if they generated a source map for all builds rather than just development.

@gkovats Can you please elaborate? In my experience the vast majority of packages you install through npm is not minified. Or if you're thinking of using the package through a CDN, in that case jsdelivr is handling that, providing you with source maps. See above answer and this SO thread for more context; https://stackoverflow.com/a/48673965/2014510.

@oskarer
Copy link
Author

oskarer commented Feb 24, 2023

For example when going to the already published CDN version (https://cdn.jsdelivr.net/npm/@editorjs/[email protected]/dist/editor.min.js) you see this;

image

@gkovats
Copy link

gkovats commented Feb 24, 2023

Was just saying for our project, we did run into the same problem with bundling, ended up just concatenating editor.js files. In truth think it's best to include all in your dist - minified, expanded, source maps. Just that if they do this for core, it should / would need to be done for editor.js tools as well. They're all minified as well.

@oskarer oskarer closed this Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants