default precompile regex may be too broad #1913

Closed
rhulse opened this Issue Jun 30, 2011 · 4 comments

3 participants

@rhulse

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.

@dmathieu

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.

@rhulse

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.

@md5

This is fixed toward 3.1.1. See #2876.

@rhulse rhulse closed this Sep 11, 2011
@rhulse

OK closed

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