Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加UMD模块打包和整理了src中, 如不需要请关闭 #1

Closed
wants to merge 2 commits into from

Conversation

LanjianNUll
Copy link

还是需要可以script直接引入就能使用的

@daGaiGuanYu
Copy link
Contributor

感谢花时间提供建议,umd 确实香。
我也曾考虑过,但最终没这样做,是因为:

打包工具屏蔽了内部函数。
而分散在多个文件的小函数正是 noty.js 保持简洁和高扩展的重要原因:让用户按需引用。
用户可能只想用核心的 41 行代码,或只想用默认的 animation 也是可能的。

当然,增加适当的配置,也可以达到按需引入的效果。
但项目结构的复杂度会飙升,尽管飙升后也不高,但还是没那么简洁了。

但还是感谢提供的宝贵意见。

小建议:把 webpack 和各 loader 放在 devDependencies 里,而不是 denpendencies 里,否则发布到 npm 会很臃肿。

我说你这个 id 这么眼熟,原来是在 popular-message 里见过,我也是受到那位前辈的启发,才写了这么个玩意。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants