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

Added separator option #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added separator option #24

wants to merge 1 commit into from

Conversation

manuelbieh
Copy link

I had one really annoying problem when using grunt-rev together with grunt-contrib-compress and gzip compression.

I configured my compress task to change file extensions of gzip compressed files to .css.gz using the ext option:

{
  expand: true,
  cwd: 'dist/htdocs/',
  dest: 'dist/htdocs/',
  src: ['**/*.css'],
  ext: '.css.gz' 
}

Everything fine - almost. Except that
my 59c28e95.test.css was renamed to 59c28e95.css.gz
my 17575a8d.vendor.css was renamed to 17575a8d.css.gz
etc.

I know it's probably a "bug" in compress or in the grunt (or even node) file reader/writer/glob but nevertheless I added an optional separator option so you can at least workaround this problem by having your files renamed to 59c28e95-test.css instead of 59c28e95.test.css for example (dash instead of dot).

Merge it if you like :)

PS: I know I could have just flipped the execution order of the compress and the rev task but it seemed like a more "reliable" way doing it that way ;)

@chaizhenhua
Copy link

@manuelbieh I had just try this feature. when i set separator option to '-' or '_', grunt can not update index.html to reference revved .css, .js file.

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

Successfully merging this pull request may close these issues.

2 participants