-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
ES module for webpack tree shaking #1015
Conversation
Following a common approach, taken by ramda for instance: https://github.com/ramda/ramda/. They compile multiple flavors of their library to distribute. Please let me know if different path is envisioned. |
@banjankri - thanks for taking on this old issue. Quite a huge PR, let me review it over the weekend 👍 |
package.json
Outdated
@@ -1,7 +1,7 @@ | |||
{ | |||
"name": "validator", | |||
"description": "String validation and sanitization", | |||
"version": "10.13.0", | |||
"version": "10.12.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can un-stage this change, version change is done by @chriso during publishing, since many other changes will be in by then.
@@ -0,0 +1,156 @@ | |||
import toDate from './lib/toDate'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are having to repeat all the code in the /es
folder, it means changes have to be made in duplicate. Could we think of a build process where this code is generated into the folder and all the necessary transformations made? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done already, please see "build:es" script in package.json. It is then invoked as part of the "build" script. Added also cleanup for it accordingly, following what was done for "clean:browser" and "clean:node".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, got it 👍
@chriso -- could you check out this PR... |
hey @chriso @profnandaa , just pinging to get the PR reviewed please :) |
Because it was introducing a huge diff, I thought @chriso will be best to take on this... |
@chriso would you maybe have some time to go through this PR please? |
@banjankri sorry for the delay in reviewing this. I agree with the general approach and would be happy to merge – we just need it to be rebased to pull in the latest changes. |
Merged with upstream master. Can see there is a non-empty diff on |
@banjankri fixed by fc3f577. |
@chriso pulled in the changes and merged again |
Looks good @banjankri. Thanks for your contribution! 😄 |
This is available in |
Sorry for a stupid question. Do I understand correctly that I can do |
Tested against webpack 4.28.x
Fixes #814