-
-
Notifications
You must be signed in to change notification settings - Fork 210
Pass timestamp option for svgo(node engine) #358
base: master
Are you sure you want to change the base?
Conversation
tasks/webfont.js
Outdated
@@ -116,7 +116,8 @@ module.exports = function(grunt) { | |||
cache: options.cache || path.join(__dirname, '..', '.cache'), | |||
callback: options.callback, | |||
customOutputs: options.customOutputs, | |||
execMaxBuffer: options.execMaxBuffer || 1024 * 200 | |||
execMaxBuffer: options.execMaxBuffer || 1024 * 200, | |||
ts: (options.ts === 0) ? 0 : options.ts || Math.floor(Date.now() / 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is far from clear. Could you add docs and tests too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll add docs and tests
This seems to solution to make woff binary to not differ from time to time. I thinks this is what I need to stop webpack from giving the font a different hash every time the font is generated. How is the status? |
@@ -6,6 +6,8 @@ var path = require('path'); | |||
var grunt = require('grunt'); | |||
var parseXMLString = require('xml2js').parseString; | |||
var wf = require('../tasks/util/util'); | |||
var crypto = require('crypto'); | |||
var Promise = require('promise'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Promises are supported since Node 0.12, so you don’t need a polyfill.
|
||
// If font created multiple times with same value as timestamp option | ||
// then md5 of created files must be the same too | ||
timestamp_same: function (test) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn’t it be easier to compare file contents? ;-)
No description provided.