mirror of https://github.com/keeweb/keeweb.git
cache manifest generation
This commit is contained in:
parent
958c9ae124
commit
c338cf097d
16
Gruntfile.js
16
Gruntfile.js
|
@ -3,7 +3,7 @@
|
||||||
var fs = require('fs'),
|
var fs = require('fs'),
|
||||||
path = require('path');
|
path = require('path');
|
||||||
|
|
||||||
var StringReplacePlugin = require("string-replace-webpack-plugin");
|
var StringReplacePlugin = require('string-replace-webpack-plugin');
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
require('time-grunt')(grunt);
|
require('time-grunt')(grunt);
|
||||||
|
@ -108,6 +108,17 @@ module.exports = function(grunt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'string-replace': {
|
||||||
|
manifest: {
|
||||||
|
options: {
|
||||||
|
replacements: [{
|
||||||
|
pattern: '# YYYY-MM-DD:v0.0.0',
|
||||||
|
replacement: '# ' + new Date().toISOString().replace(/T.*/, '') + ':v' + require('./package').version
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
files: { 'dist/manifest.appcache': 'app/manifest.appcache' }
|
||||||
|
}
|
||||||
|
},
|
||||||
webpack: {
|
webpack: {
|
||||||
js: {
|
js: {
|
||||||
entry: {
|
entry: {
|
||||||
|
@ -217,6 +228,7 @@ module.exports = function(grunt) {
|
||||||
'sass',
|
'sass',
|
||||||
'postcss',
|
'postcss',
|
||||||
'inline',
|
'inline',
|
||||||
'htmlmin'
|
'htmlmin',
|
||||||
|
'string-replace'
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html manifest="manifest.appcache">
|
||||||
<head lang="en">
|
<head lang="en">
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>KeeWeb</title>
|
<title>KeeWeb</title>
|
||||||
|
@ -15,4 +15,4 @@
|
||||||
<p>This app is written entirely in JavaScript. Please, enable JavaScript to run it.</p>
|
<p>This app is written entirely in JavaScript. Please, enable JavaScript to run it.</p>
|
||||||
</noscript>
|
</noscript>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
CACHE MANIFEST
|
||||||
|
|
||||||
|
# YYYY-MM-DD:v0.0.0
|
||||||
|
|
||||||
|
CACHE:
|
||||||
|
index.html
|
|
@ -21,6 +21,7 @@
|
||||||
"grunt-inline-alt": "^0.3.10",
|
"grunt-inline-alt": "^0.3.10",
|
||||||
"grunt-postcss": "^0.6.0",
|
"grunt-postcss": "^0.6.0",
|
||||||
"grunt-sass": "^1.0.0",
|
"grunt-sass": "^1.0.0",
|
||||||
|
"grunt-string-replace": "^1.2.0",
|
||||||
"grunt-webpack": "^1.0.11",
|
"grunt-webpack": "^1.0.11",
|
||||||
"load-grunt-tasks": "^3.2.0",
|
"load-grunt-tasks": "^3.2.0",
|
||||||
"string-replace-webpack-plugin": "0.0.2",
|
"string-replace-webpack-plugin": "0.0.2",
|
||||||
|
|
Loading…
Reference in New Issue