Khertan Khertan - 5 months ago 13
AngularJS Question

Using easy-fit in an angularjs application without requirejs

I m trying to use a js library easy-fit (https://github.com/pierremtb/easy-fit) in an angularjs application (https://github.com/khertan/forrunners).

Easy-fit use gulp, babel. And i would like to transpil and compile to a unique javascript file.

How can i use gulp-babel to transpile without require call ?

Thank you,

Answer

After reading documentation

There is no requirejs dependancy at all.

But as there is some require() call in the lib which is a node method, browserify the lib is required...

How i ve made and used the lib

$ browserify easy-fit.js --standalone easy-fit > easy-fit.bundle.js

Include it in your index.html :

<script src="lib/easy-fit.bundle.js"></script>

And now call it in your javascript :

var EasyFit = window.easyFit.default;
Comments