Skip to content
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

requirejs:compile #187

Closed
grommas opened this issue Nov 3, 2014 · 10 comments
Closed

requirejs:compile #187

grommas opened this issue Nov 3, 2014 · 10 comments
Labels

Comments

@grommas
Copy link

grommas commented Nov 3, 2014

It is possible to load scrollMagic as an AMD with requirejs. As far as I know your solution contains a call of two apps with the duplication of the require.config path—the dirty way. As I use the use-init boilerplate, I have a problem with this kind of solution. The dev version works—although it includes an error. But in the build version it is not possible to get your method work.

Is it possible to separate ScrollMagic and ScrollScene by defining two modules inside your plugin and to enable the use of your tool like that in the future? Or is there any way of using it without calling the path twice?

require.config({
     paths: {
          ScrollMagicCore: '../components/ScrollMagic/js/jquery.scrollmagic.min'
     },
     bundles: {
          ScrollMagicCore: ['ScrollMagic', 'ScrollScene']
     }
});

terminal excerpt:
[Error: Module loading did not complete for: main, modules/scrollMagic, ScrollScene The following modules share the same URL. This could be a misconfiguration if that URL only has one anonymous module in it: /path/init/components/ScrollMagic/js/jquery.scrollmagic.min.js: ScrollScene, ScrollMagic] }

@janpaepke
Copy link
Owner

Hi Jacob,
does this help you?
#160 (comment)

regards,
J

@grommas
Copy link
Author

grommas commented Nov 6, 2014

Hey Jan

it’s not working like that, caused by the duplicate path. maybe the fix from aaronjensen will be a solution. I have built a new version locally with this enhancement but could not get it work yet. I’m more a designer, less developer. I tried almost every possibility without being able to solve the problem.

@janpaepke
Copy link
Owner

Hi Jakob,
For me it does work with require.js (otherwise I obviously wouldn't have released it).
Maybe you can provide some way for me to test your issue? A js fiddle possibly?

regards,
J

@janpaepke
Copy link
Owner

update: it works for me for both the minified and uncompressed version...

@grommas
Copy link
Author

grommas commented Nov 7, 2014

it's not working this way with ‹r.js› because there is a duplication of the paths.

Running "requirejs:compile" (requirejs) task { [

Error: Module loading did not complete for: main, modules/scrollMagic, TimelineMax, ScrollScene

The following modules share the same URL. This could be a misconfiguration if that URL only has one anonymous module in it:

/init/components/gsap/src/minified/TweenMax.min.js: TimelineMax, TweenMax

/init/components/ScrollMagic/js/jquery.scrollmagic.min.js: ScrollScene, ScrollMagic

at Function.build.checkForErrors (/init/node_modules/grunt-contrib-requirejs/node_modules/requirejs/bin/r.js:27417:19) ] }

@grommas grommas changed the title require.js bundle requirejs:compile Nov 7, 2014
@janpaepke
Copy link
Owner

Hi Jakob,
Version 1.3.0 should solve your problem.
Please read here: https://github.com/janpaepke/ScrollMagic/wiki/Getting-Started-:-Using-AMD

Please let me know if this does the trick.

@grommas
Copy link
Author

grommas commented Nov 17, 2014

Works like a charm, thank you very much for your support and the fast update!

@janpaepke
Copy link
Owner

yw

@krnlde
Copy link

krnlde commented Nov 25, 2014

Yeah there was a change between #160 and the current v1.3.0 of ScrollMagic. I recognized it recently. Should I update #160?

@janpaepke
Copy link
Owner

Yes, you can.
I think linking to https://github.com/janpaepke/ScrollMagic/wiki/Getting-Started-:-Using-AMD should be sufficient though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants