Comments (4)
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.
@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.
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.
Thanks, I think that's got me heading in the right direction.
from django-require.
Related Issues (20)
- Include CSS with cache-busting filename? HOT 4
- gzip HOT 3
- Rhino often runs out of stack HOT 2
- REQUIRE_EXCLUDE setting doesn't work files deeper in path HOT 1
- "removeCombined" build profile setting has no effect HOT 1
- Update resources HOT 2
- Can't set REQUIRE_BASE_URL to empty string (aka exactly STATIC_ROOT) HOT 2
- I want to get build.txt output of r.js optimizer HOT 2
- Error running collect static with OptimizedCachedStaticFilesStorage HOT 5
- OptimizedCachedStaticFilesStorage and changing files names HOT 1
- Clash with django-pipeline? HOT 6
- management command just to build the standalone modules HOT 5
- add async attribute to the tag HOT 1
- Variable REQUIRE_BASE_URL for standalone modules? HOT 17
- Output of require_module template tag gets escaped in Django 1.9 HOT 2
- Add paths to REQUIRE_EXCLUDE HOT 4
- Best practices for using django-require in multi-page apps HOT 2
- Reusing paths between standalone module and development server configuration HOT 6
- require_module template tag doesn't reference hashed file HOT 1
- django 1.11 build failing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-require.