Append timestamp to files to avoid CDN megacaching issues - see https://bugzilla.mozilla.org/show_bug.cgi?id=981801#c27
This commit is contained in:
Родитель
70478f4cef
Коммит
62b1b8f70f
6
build.js
6
build.js
|
@ -8,6 +8,7 @@ var fs = require('fs');
|
|||
var archiver = require('archiver');
|
||||
var sha1sum = require('shasum');
|
||||
var copyFile = require('fast-copy-file');
|
||||
var dateformat = require('dateformat');
|
||||
var config = require('./config');
|
||||
var distDir = 'dist';
|
||||
|
||||
|
@ -83,6 +84,7 @@ function buildProject(projectPath, remotePath) {
|
|||
var iconFilename = base + '.png';
|
||||
var srcIcon = path.join(projectPath, 'icon.png');
|
||||
var dstIcon = path.join(distDir, iconFilename);
|
||||
var timestamp = '?t=' + dateformat(new Date(), 'yyyymmddHHMMss');
|
||||
|
||||
compress(projectPath, outputPath, function(compressedSize, sha1sum) {
|
||||
|
||||
|
@ -101,8 +103,8 @@ function buildProject(projectPath, remotePath) {
|
|||
}
|
||||
|
||||
deferred.resolve({
|
||||
file: remotePath + zipFilename,
|
||||
icon: remotePath + iconFilename,
|
||||
file: remotePath + zipFilename + timestamp,
|
||||
icon: remotePath + iconFilename + timestamp,
|
||||
size: compressedSize,
|
||||
sha1: sha1sum,
|
||||
name: name,
|
||||
|
|
|
@ -15,11 +15,12 @@
|
|||
],
|
||||
"author": "Mozilla",
|
||||
"license": "Apache 2",
|
||||
"devDependencies": {
|
||||
"dependencies": {
|
||||
"archiver": "~0.5.1",
|
||||
"dateformat": "^1.0.8-1.2.3",
|
||||
"fast-copy-file": "0.0.1",
|
||||
"glob": "~3.2.8",
|
||||
"q": "~1.0.0",
|
||||
"archiver": "~0.5.1",
|
||||
"shasum": "~1.0.0",
|
||||
"fast-copy-file": "0.0.1"
|
||||
"shasum": "~1.0.0"
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче