summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Metson <simon+github@cloudant.com>2013-03-11 15:30:04 +0000
committerSimon Metson <simon+github@cloudant.com>2013-03-11 15:30:04 +0000
commit3d4781de0b37ada0ebff3a6c4dc2a1f6da9feb95 (patch)
tree2b06c8a3379e7e92a7092a9c6c9ea64e6da1221a
parent0649bafacf15669d294258187e6c189759c1c93a (diff)
downloadcouchdb-3d4781de0b37ada0ebff3a6c4dc2a1f6da9feb95.tar.gz
remove templating configuration from grunt.js
-rw-r--r--src/fauxton/grunt.js64
-rw-r--r--src/fauxton/settings.json.default11
2 files changed, 27 insertions, 48 deletions
diff --git a/src/fauxton/grunt.js b/src/fauxton/grunt.js
index 8abdd0200..08c95af1d 100644
--- a/src/fauxton/grunt.js
+++ b/src/fauxton/grunt.js
@@ -68,6 +68,22 @@ module.exports = function(grunt) {
return theAssets;
}();
+ var templateSettings = function(){
+ var defaultSettings = {
+ "template": {
+ "src": "assets/index.underscore",
+ "dest": "dist/debug/index.html",
+ "variables": {
+ "assets_root": "./",
+ "requirejs": "require.js",
+ "base": null
+ }
+ }
+ };
+ var settings = grunt.file.readJSON("settings.json") || defaultSettings;
+ return {template: settings.template};
+ }();
+
grunt.initConfig({
// The clean task ensures all files are removed from the dist/ directory so
@@ -119,53 +135,7 @@ module.exports = function(grunt) {
// Create static html files from templates, for managing change of script
// or css name.
- template: {
- couchdb:{
- src: 'assets/index.underscore',
- dest: '../../share/www/fauxton/index.html',
- variables: {
- assets_root: '/_utils/fauxton/',
- requirejs: 'require.min.js',
- base: '/_utils/fauxton/'
- }
- },
- couchdebug:{
- src: 'assets/index.underscore',
- dest: '../../share/www/fauxton/index.html',
- variables: {
- assets_root: '/_utils/fauxton/',
- requirejs: 'require.js',
- base: '/_utils/fauxton/'
- }
- },
- release: {
- src: 'assets/index.underscore',
- dest: 'dist/release/index.html',
- variables: {
- assets_root: '/',
- requirejs: 'require.min.js',
- base: '/'
- }
- },
- debug: {
- src: 'assets/index.underscore',
- dest: 'dist/debug/index.html',
- variables: {
- assets_root: '/',
- requirejs: 'require.js',
- base: '/'
- }
- },
- couchapp: {
- src: 'assets/index.underscore',
- dest: 'dist/debug/index.html',
- variables: {
- assets_root: './',
- requirejs: 'require.js',
- base: null
- }
- }
- },
+ template: templateSettings,
// The concatenate task is used here to merge the almond require/define
// shim and the templates into the application code. It's named
diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default
index 01c04a4dc..32cd774b5 100644
--- a/src/fauxton/settings.json.default
+++ b/src/fauxton/settings.json.default
@@ -4,5 +4,14 @@
{ "name": "logs" },
{ "name": "stats" },
{ "name": "contribute" }
- ]
+ ],
+ "template": {
+ "src": "assets/index.underscore",
+ "dest": "dist/debug/index.html",
+ "variables": {
+ "assets_root": "./",
+ "requirejs": "require.js",
+ "base": null
+ }
+ }
}