Starting from 3.2.4 Rails assets:precompile task just ignores files with names like 'index.(css|js)'.
Because of #3993 I had to manually add index files to config.assets.precompile array. Now it just skips such files. So, application that was working perfectly fine on 3.2.3 throws AssetNotPrecompiledError constantly.
Here is the showcase: https://github.com/rwz/rails-assets-degradation-showcase
The public folder contains assets compiled on 3.2.3 and on current 3.2.6. The difference is that folder was completely ignored in 3.2.6.
[ 'folder/index.js' ]
[ 'folder.js' ]
This is something that was working before and not working now, so it is clearly a regression for me. Also, i'm explicitly adding index.js file which exists AND this code works in development but not in production. I think this is both misleading and inconsistent.
What i think should actually happen here is this:
@rwz I've got your point, I think it justified, I can take a look, but it would be nice to hear core team opinion.
Also breaks if you use *.js and *.css for the asset list. It loads everything but the index.(js|css).
I found the same as @edgard. I was using *.js for the asset precompile list, and found that some_folder/index.js was changed to some_folder.js once precompiled after upgrading from 3.2.3 to 3.2.6.
We weren't expecting this change, and it broke our production site. Only after scrambling to fix this issue and researching further did our team find this documentation detailing the special behavior of assets named index.js/css.
This is hitting us too. We were on 3.2.3 and do things like
Any chance this will be fixed, or is it truly not a bug (because of the index.js manifest feature of Sprockets)?
I recently upgraded to 3.2.8 and encountered this issue. I was able to solve it by changing this in the production.rb config file:
config.assets.precompile += ['folder']
config.assets.precompile += ['folder.js']
and then using it in the specific views through:
where folder is the folder name containing the index.js file. Basically, adding the '.js' extension to the folder name in the precompile config did the trick. I don't why this behavior changed; the previous one made more sense to me.
Fixed @ 19987b6
question: I noted that when I created an "application-all.css.scss" file in /assets/stylesheets, and my "application.css.scss" file was in /assets/stylesheets/all, the command in my config.assets.precompile -
config.assets.precompile += %w( application-all.css.scss application-print.css.scss application-ie.css.scss)
Was ignored. Rather, I needed to remove the ".scss" extension, even though the files end in ".scss". The following works:
config.assets.precompile += %w( application-all.css application-print.css application-ie.css)
This seems to refute the statement in the comments in 3.2.8
"# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)"
Since the .scss was not added.
@cvandermey scss is a preproccessor in that case. For assets pipeline this file's called application-all.css. It doesn't care if it's compiled out of SCSS or SASS or even LESS.
Questions are best asked on StackOverflow, not on Issues.