-
Notifications
You must be signed in to change notification settings - Fork 49
How can I use this module in IE9? #15
Comments
The npm package is compiled in JavaScript 5, you can simply import it in your project and create a bundle using browserify or webpack. About the UI I haven't tested IE yet, so I can't guarantee it will work correctly. I'll verify it in the following days |
So much clear ! Thanks a lot ~ |
I install the datepicker via npm, and create a bundle.js using Browserify, but I found a new problem: bundle.js is closeto 1000KB, it is too heavyweight in browser. Is there any way to make it lighter? |
Does bundle.js include all the locale files? |
@luokuning I think I misunderstood your question before. The bundle.js you're referring to probably contains other libraries (like ReactJS) that's why Its size is around 1mb. Our datepicker, if minified, should be around ~40/50kb which would decrease even more if gzipped. The biggest part of its size comes from Moment.js which minified is about ~34kb. |
@FrancescoCioria I realized that I have missing something on Browserify.First time I packed the DatePicker.js by the following code:
and then the size of DatePicker_browser.js is nearly 1000KB. Then I checked the Browserify home page and found that if there is no need to include some file I should use the ' --ignore' param, so my code become follows:
And the file become lighter as expected, but it still approaching 130KB. Am I still missing something in Browserify or anything else? |
@gabro Yes, I think so, as Browserify will pack all files needed into one file. |
What browserify does is to recursively include in the bundle every So the idea is that somewhere in your react application you do
and that causes the datepicker to be included by browserify into the final bundle. So I guess the real question is: what do you need |
@gabro Yes, I have loaded react.js before, so I want to pack |
Precisely.
where the arrow means "requires", you can just run browserify on This is exactly why we distribute the source, rather than a standalone minified build. This way you can build and optimize your app as you prefer, using any build system (wepack, browserify, you name it!) |
So it is, I got you! Thanks you guys for creating a awesome datetimepicker component, and helping to solve my puzzles! 😄 |
Many thanks,UI is perfect for my project! but I notice that the code has used some new features of es6, so how can I implement this module in IE9 with ReactJs ? :)
The text was updated successfully, but these errors were encountered: