-
Notifications
You must be signed in to change notification settings - Fork 14
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
Convert classes into tree-shakable ES6 modules #37
base: master
Are you sure you want to change the base?
Conversation
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.
👍
What changes did you have in mind for the file structure?
I think the source file structure doesn't have to change.
In dist
, the module files could be moved out of their sub folders directly into dist
after building.
Or do you even want to move the dist files directly into the packages root?
We could do this with a npm script that moves the files up, builds the package, then removes the files.
Yes, I would like to build the package in a way that does not include the |
However, maybe this can simply be achieved by instead of packaging the |
bdabadc
to
d3e8659
Compare
Additionally to the removal of the |
87a7d3f
to
4c0a28d
Compare
Convert all classes with only static methods into tree-shakable ES6 modules (as explained in #29 (comment)). Utilities can now be directly accessed as
which only bundles
isSafari
and tree-shakes all other methods, that were previously included (and thus bundled) in theBrowserDetection
class.(Changing the import path is a topic for another PR, because it would likely change the whole file structure.)
This change is backwards-compatible, as the
main.js
still exports whole namespaces with the original names. Please check if you agree.The diff should be watched with whitespace turned off, since the indentation got reduced by one level.