Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for keeping compiled files #11

Closed
hferradj opened this issue Aug 10, 2014 · 10 comments
Closed

Option for keeping compiled files #11

hferradj opened this issue Aug 10, 2014 · 10 comments
Labels

Comments

@hferradj
Copy link

Hi there,

Thanks a lot for your great plugin.

I have a small request. I'm working with pretty big sass files and the compilation time is quite long.

It's not really a big problem when I'm actively changing the content of these files and checking the results, but I think it would be very useful to have an option to keep the generated css files instead of deleting/regenerating them every time we refresh a page. That way, when we're not updating sass files, we could just turn this option on and don't have to wait 10+ seconds each time we refresh a page.

In SassProcessor.groovy, we could wrap this:

        def outputFile = new File(outputFileName)
        if(outputFile.exists()) {
            outputFile.delete()
        }

with something like:

if(!grailsApplication.config.grails.assets.plugin."sass-asset-pipeline".keepCompiledFiles) {
... delete the file...
}

I went ahead and changed the file in my fork and sent a pull request.

Thanks :)

@raulgomis
Copy link

+1 to this pull-request! Additionally it'd be great to check the modified time of the file to know when to recompile.

@davydotcom
Copy link
Contributor

We dont exactly keep this generated file for a reason. It mucks up the assets folder. Your results are still cached in the .sass-cache folder so caching and diff checking are still functioning 100%

@hferradj
Copy link
Author

Is there a setting for activating the asset plugin's cache? Because right now it's not caching anything. From what I understand the cache is only active in non-development environment.

Without the modification above, everytime I refresh a page the css file is re-generated. I'm using "foundation framework" 's sass file, it's quite big and it takes 10 seconds to convert to css.

@davydotcom
Copy link
Contributor

Typically the asset-pipliene cache is turned off for sass because the compass plugin does the cache management. Ill take a look and see if somethings up.

David Estes

On August 28, 2014 at 12:06:32 PM, AbuJunayd (notifications@github.com) wrote:

Is there a setting for activating the asset plugin's cache? Because right now it's not caching anything. From what I understand the cache is only active in non-development environment.

Without the modification above, everytime I refresh a page the css file is re-generated. I'm using "foundation framework" 's sass file, it's quite big and it takes 10 seconds to convert to css.


Reply to this email directly or view it on GitHub.

@raulgomis
Copy link

Hi, I agree with @AbuJunayd..Without modifying any file, the project css files get refreshed every time..and it is very difficult to develop. @davydotcom you can see a working example in grails here: https://github.com/raulgomis/beerstrap/tree/release/v0.2

@davydotcom
Copy link
Contributor

so the log doesn’t say “unchanged” ?

David Estes

On August 28, 2014 at 12:26:45 PM, Raúl Gomis (notifications@github.com) wrote:

Hi, I agree with @AbuJunayd..Without modifying any file, the project css files get refreshed every time..and it is very difficult to develop. @davydotcom you can see a working example in grails here: https://github.com/raulgomis/beerstrap/tree/release/v0.2


Reply to this email directly or view it on GitHub.

@raulgomis
Copy link

nope! says: "created filename.css" everytime the page is refreshed, even with no changes in the SCSS files or any other file.

@davydotcom
Copy link
Contributor

ok thats a bug then . Ill take a look.

David Estes

On August 28, 2014 at 1:34:57 PM, Raúl Gomis (notifications@github.com) wrote:

nope! says: "created filename.css" everytime the page is refreshed, even with no changes in the SCSS files or any other file.


Reply to this email directly or view it on GitHub.

@raulgomis
Copy link

Ok! thanks @davydotcom

@davydotcom davydotcom reopened this Aug 28, 2014
@davydotcom davydotcom added the bug label Aug 28, 2014
@davydotcom
Copy link
Contributor

Decided to fix the cache manager in asset-pipeline to handle this instead. Should be much better in 1.9.1 of sass

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

No branches or pull requests

3 participants