GithubHelp home page GithubHelp logo

Comments (4)

etianen avatar etianen commented on August 27, 2024

Are you using RequireJS to dynamically load scripts or assets other than
the main.js script?

Typically, a monolithic single main.js script is used, which is loaded in
fingerprinted form via the {% require_module %} tag, and no further access
to fingerprinted files is necessary.

Otherwise, if you do need to use requirejs to load the fingerprinted files,
then you're going to need a paths config. Generating one via
OptimizedCachedStaticFilesStorage sounds ideal, although how this would be
integrated with the rest of the build is unclear.

On 28 May 2013 16:45, Eric Brelsford [email protected] wrote:

I've successfully run collectstatic with STATICFILES_STORAGE set to
require.storage.OptimizedCachedStaticFilesStorage, but it's not clear to
me how I would tell requirejs to use the fingerprinted files.

Would I need to put each file (with its fingerprint) explicitly in my
config's paths? And if so, would it make sense to extend
OptimizedCachedStaticFilesStorage to do this?

Or is there another solution for this I don't know about?


Reply to this email directly or view it on GitHubhttps://github.com//issues/22
.

from django-require.

ebrelsford avatar ebrelsford commented on August 27, 2024

@etianen Yes, I am currently using RequireJS to load scripts other than main.js. I'm not using a build profile right now--would that create the monolithic main.js that I would refer to? I'd definitely rather to that than hack that paths config.

from django-require.

etianen avatar etianen commented on August 27, 2024

Creating a build profile and defining at least one module would allow you
to concatenate all your JS into one huge file, avoiding the need to hack
the paths config.

If you set REQUIRE_BUILD_PROFILE to something sensible like "app.build.js",
then run ./manage.py require_init, you'll get a generated build profile
that'll get you started.

On 28 May 2013 17:43, Eric Brelsford [email protected] wrote:

@etianen https://github.com/etianen Yes, I am currently using RequireJS
to load scripts other than main.js. I'm not using a build profile right
now--would that create the monolithic main.js that I would refer to? I'd
definitely rather to that than hack that paths config.


Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-18563392
.

from django-require.

ebrelsford avatar ebrelsford commented on August 27, 2024

Thanks, I think that's got me heading in the right direction.

from django-require.

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.