rykdesjardins / js-calendar

The lightest Javascript calendar out there, without any dependency.
MIT License
34 stars 7 forks source link

Adding support for require via browserify #9

Closed jamacon36 closed 6 years ago

jamacon36 commented 6 years ago

Thanks for this library.

This was recompiled with babelify so that a require call will add the libs to the window object in the same way that just including the script in a script tag will:

require('vanilla-js-calendar')
var elem = document.getElementById("myCalendar");
var calendar = new JSCalendar(elem, { /* options */ }).init().render();

The compile command used was: npx browserify dev/js-calendar.js -o dist/js-calendar.js -t [ babelify --presets [ "es2015" ] ]

Thanks again for this!

jamacon36 commented 6 years ago

This will address issue #4

jamacon36 commented 6 years ago

Closing for improved approach in a newer pull