Code Monkey home page Code Monkey logo

Comments (6)

ihortymoshenko avatar ihortymoshenko commented on August 17, 2024

@rayrigam, try to define a few paths with different names.

from hearsayrequirejsbundle.

rayrigam avatar rayrigam commented on August 17, 2024

@IgorTimoshenko , if I do that it seems like I would have to write a condition in my main or modules files to check if the scripts from the CDN loaded (and if not load the local ones), which is what I was trying to avoid. It seems like I could do it from within the requirejs.config definition in my main.js file as shown here http://stackoverflow.com/a/12075285, moving all the paths definition to main.js, but I would still not be able to define a fallback for the require.min.js file...

from hearsayrequirejsbundle.

ihortymoshenko avatar ihortymoshenko commented on August 17, 2024

@rayrigam, looks like it is possible to add the ability to specify array values for the paths config. I will add this ASAP.

from hearsayrequirejsbundle.

rayrigam avatar rayrigam commented on August 17, 2024

@IgorTimoshenko , good to hear! Looking forward to it!

from hearsayrequirejsbundle.

rayrigam avatar rayrigam commented on August 17, 2024

@IgorTimoshenko Thanks! The paths now work with arrays to be able to define fallback files (which is what I was looking for). However, it is worth mentioning that paths locations do not work with strings anymore in the new bundle version. People will need to update by adding square brackets to the paths defined in the config.yml file. Also, one more question: is there a way to define a fallback for the require.min.js file itself? defined in:

hearsay_require_js:
    base_directory: %kernel.root_dir%/../src/Groupidea/SiteBundle/Resources/public/js
    require_js_src: //cdnjs.cloudflare.com/ajax/libs/require.js/2.1.5/require.min.js

It would be nice to be able to define an array for the require_js_src as well (as above). It still only accepts a scalar/string...

from hearsayrequirejsbundle.

ihortymoshenko avatar ihortymoshenko commented on August 17, 2024

@rayrigam, not at all. I will think about your comment. As for path fallback for RequireJS, I did not find any about it in docs.

from hearsayrequirejsbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.