Closed stefan-it closed 8 years ago
Hi,
this PR exposes WordCloud on the global object to get this awesome library working with the (latest) RequireJS version.
WordCloud
It simply exposes WordCloud before the define('wordcloud', [], function() { return WordCloud; }); call.
define('wordcloud', [], function() { return WordCloud; });
Notice: As it uses a named AMD module called wordcloud the RequireJS configuration should look like:
wordcloud
requirejs.config({ baseUrl: 'bower_components', paths: { "wordcloud" : "wordcloud2.js/src/wordcloud2", } });
Then the WordCloud module is available. I did testings with:
RequireJS
and wordcloud2 in version 1.0.5 and master, Final output of grunt test is:
wordcloud2
master
grunt test
Took 2102ms to run 23 tests. 23 passed, 0 failed. Done, without errors.
What do you think about merging this PR?
I've never used RequireJS with this library actually so if this works I am fine with merging it. Thanks for the PR!
Hi,
this PR exposes
WordCloud
on the global object to get this awesome library working with the (latest) RequireJS version.It simply exposes
WordCloud
before thedefine('wordcloud', [], function() { return WordCloud; });
call.Notice: As it uses a named AMD module called
wordcloud
the RequireJS configuration should look like:Then the
WordCloud
module is available. I did testings with:RequireJS
version 2.1.15RequireJS
version 2.2.0and
wordcloud2
in version 1.0.5 andmaster
, Final output ofgrunt test
is:What do you think about merging this PR?