0

——————————————————————————— Trying to use requirejs with easeljs …. this works!

<head>
            <title>Trial Run</title>
            <link rel="stylesheet" type="text/css" href="mainStyle.css">
            <script src="http://code.createjs.com/1.0.0/easeljs.min.js"></script>
            <script src="http://code.createjs.com/1.0.0/tweenjs.min.js"></script>
            <script data-main="js/app" src="js/lib/require.js"></script>
    </head>

——————————————————————————— When I remove the underlined code and setup the ’requirejs.config’ (below), it fails with … ‘app.html:51 Uncaught ReferenceError: createjs is not defined’

requirejs.config({
        "baseUrl": "js/lib",
        "paths": {
        "app": "../app",
        "easel": "//code.createjs.com/1.0.0/easeljs.min.js",
        "tween": "//code.createjs.com/1.0.0/tweenjs.min.js"
 },
 "shim": {
            "jquery.alpha": ["jquery"],
            "jquery.beta": ["jquery"],
            "easel": {
                exports: 'createjs'
            },
            "tween": {
                deps: ["easel"],
                exports: "Tween"
            }
 }

});

// Load the main app module to start the app requirejs(["app/main"]);

——————————————————————————— Picture of File arrangement ———————————————————————————

1
  • Syntax is wrong, this works ! requirejs.config({ "baseUrl": "js/lib", "paths": { "app": "../app", "easel": 'easeljs.min', "tween": 'tweenjs.min' }, "shim": { "jquery.alpha": ["jquery"], "jquery.beta": ["jquery"], easel: { exports: 'createjs' }, tween: { deps: ['easel'], exports: 'tween' } } }); // Load the main app module to start the app requirejs(["app/main"]); Mar 14, 2018 at 21:13

1 Answer 1

0

Syntax is wrong, this works !

requirejs.config({ "baseUrl": "js/lib", "paths": { "app": "../app", "easel": 'easeljs.min', "tween": 'tweenjs.min' }, "shim": { "jquery.alpha": ["jquery"], "jquery.beta": ["jquery"], easel: { exports: 'createjs' }, tween: { deps: ['easel'], exports: 'tween' } } });

// Load the main app module to start the app requirejs(["app/main"]);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.