Code Monkey home page Code Monkey logo

Comments (3)

AsaAyers avatar AsaAyers commented on August 17, 2024

I sort of found the problem but not a great solution yet. If I leave the base url alone it always requests js/namespace/script.js. I changed my config_dev to use /app_dev.php/js as the base_url, but assectic then uses that when building the routes. so now my files are only accessible when requesting /app_dev.php/app_dev.php/js/namespace/script.js

Right now I'm working around this by configuring require manually, but I dont' think this is a permanent solution.

<script type='text/javascript'> var require = {{ require_js.config|json_encode|raw }}; require.baseUrl = '/app_dev.php/' + require.baseUrl; </script>

{% javascripts filter='?requirejs' '@MyBundle/Resources/scripts/main.js' output="js/main.js" %}
{{ require_js_initialize({ 'configure' : false, 'main' : asset_url }) }}
{% endjavascripts %}

from hearsayrequirejsbundle.

AsaAyers avatar AsaAyers commented on August 17, 2024

Your fix in #1 solved my problem here too. I think my problem was caused by trying to use bigethan's workaround

from hearsayrequirejsbundle.

kmontag avatar kmontag commented on August 17, 2024

Yep, files in your configured directories (%kernel.root_dir%/scripts and */Resources/scripts in the README) are served as Assetic assets. So there's no bundle-specific routing - you can check out the Hearsay\RequireJSBundle\Factory namespace to see how the assets and their names are generated.

I'm adding an option to hide unoptimized Javascript files, which should be useful in production environments :)

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.