Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Include configuration with require.js download so it's cached #242

Open
wuservices opened this issue Jul 8, 2015 · 0 comments
Open

Include configuration with require.js download so it's cached #242

wuservices opened this issue Jul 8, 2015 · 0 comments

Comments

@wuservices
Copy link
Contributor

It'd be great if the config could be part of the require.js download instead of being duplicated on every page. For complex apps, the config could get quite large so caching it is ideal.

At the same time, it would be nice to be able to include a few other assets with require.js such as some essential libraries that you want to be available ASAP without another round-trip. A good example of this would be an image lazy loading library that you might use on every page.

I tried to tackle both these issues in paperculture@0dfd7e4 where require.js is loaded by bootstrapper.js.erb and I expose the require.js config as a helper. It almost worked, but the checksums for each asset filename are wrong in the generated require.js config presumably due to the order that things were generated in.

I'm not super familiar with the asset pipeline, is there an easy fix for this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant