default precompile regex may be too broad #1913

rhulse opened this Issue Jun 30, 2011 · 4 comments

3 participants


The current default:

@assets.precompile = [ /\w+\.(?!js|css).+/, "application.js", "application.css" ]

appears too broad.

If you have application.js

// = require this
// = something.with.dots

You get application-hash.js AND something.with.dots-hash.js in /public/assets.

In fact you get ALL files that match the REGEX in asset paths [ ]

Or it might just be a thing to note in the docs.


assets:precompile will generate all the files located in the top-directory assets.
If your file is meant to be included, you should put it in a subdirectory and include it from your application.js (or any other name) file.


Sorry, I should have been a lot clearer. The regex is capturing files that have no manifest and are not in any manifest, and baking them to /public/assets. Perhaps this is an issue in Sprockets? My work around is to set precompile to only the files with manifests.


This is fixed toward 3.1.1. See #2876.

@rhulse rhulse closed this Sep 11, 2011

OK closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment