added gruntfile and package.json for appcache generator

This commit is contained in:
andygup 2014-04-01 09:33:35 -06:00
parent 3c8f7e5a11
commit a82ceebc18
2 changed files with 88 additions and 0 deletions

62
Gruntfile.js Normal file
View File

@ -0,0 +1,62 @@
/* --------------------------------------------------------
* http://gruntjs.com/getting-started
* http://gruntjs.com/sample-gruntfile
*
* https://www.npmjs.org/package/grunt-manifest
*
* --------------------------------------------------------
*/
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
manifest: {
generate: {
options: {
basePath: "./",
cache: ["# <%= pkg.name %>, version: <%= pkg.version %>",
"# ArcGIS API for JavaScript files",
"<%= pkg.baseURL %>/",
"<%= pkg.baseURL %>/init.js",
"<%= pkg.baseURL %>/js/dojo/dojox/gfx/svg.js",
"<%= pkg.baseURL %>/js/dojo/dojo/resources/blank.gif",
"<%= pkg.baseURL %>/js/esri/css/esri.css",
"<%= pkg.baseURL %>/js/esri/nls/jsapi_en-us.js",
"<%= pkg.baseURL %>/js/esri/images/map/logo-sm.png",
"<%= pkg.baseURL %>/js/esri/images/map/logo-med.png",
"<%= pkg.baseURL %>/js/esri/dijit/images/ajax-loader.gif",
"<%= pkg.baseURL %>/js/esri/dijit/images/popup.png",
"http://services.arcgisonline.com/ArcGIS/rest/info?f=json",
"http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=json&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback",
"# required custom libs",
"modules/tiles.js",
"js/app.js",
"css/style.css"],
network: ["http://*", "https://*"],
/*fallback: ["/ /offline.html"],*/
exclude: ["js/jquery.min.js", "libs/**.sass", "libs/**/src"],
/*preferOnline: true,*/
verbose: true,
timestamp: true
},
src: [
"*.html",
/*"js/*.min.js",*/
"libs/IndexedDBShim/dist/*.min.js",
"libs/offline-editor-js/tiles/*.js",
"images/*",
"css/*.css"
],
dest: "manifest.appcache"
}
}
});
grunt.loadNpmTasks('grunt-manifest');
grunt.registerTask('buildManifest', ['manifest:generate'])
grunt.registerTask('default', ['buildManifest'])
};

26
package.json Normal file
View File

@ -0,0 +1,26 @@
{
"//": [
"http://nodejs.org/download/",
"http://howtonode.org/how-to-install-nodejs",
"https://www.npmjs.org/doc/cli/npm-init.html"
],
"name": "manifest-generator",
"baseURL": "//js.arcgis.com/3.8",
"version": "0.0.1",
"private": true,
"description": "manifest generator project",
"repository": {
"type": "git",
"url": "https://github.com/andygup/appcache-test-js.git"
},
"author": "Lloyd Heberlie",
"license": "Apache 2",
"bugs": {
"url": "https://github.com/andygup/appcache-test-js/issues"
},
"dependencies": {},
"devDependencies": {
"grunt": "^0.4.4",
"grunt-manifest": "^0.4.0"
}
}