grunt-jasper
Advanced tools
Comparing version 0.5.1 to 0.5.2
@@ -71,3 +71,4 @@ /* | ||
fileVersion: true, | ||
defaultRoutePath: '/' | ||
defaultRoutePath: '/', | ||
jDebugEnabled: true | ||
}, | ||
@@ -74,0 +75,0 @@ |
{ | ||
"name": "grunt-jasper", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "Grunt task to build and package jasper application", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/jasperjs/grunt-jasper", |
@@ -118,2 +118,15 @@ # grunt-jasper [![Build Status](https://travis-ci.org/jasperjs/grunt-jasper.svg?branch=master)](https://travis-ci.org/jasperjs/grunt-jasper) | ||
#### options.jDebugEnabled | ||
type: 'Boolean' | ||
Default value: false | ||
Is jDebug enabled. If enabled task will reference to index page jDebugSrc script if options.package == false. | ||
#### options.jDebugSrc | ||
type: 'String' | ||
Default value: 'node_modules/jdebug/lib/jdebug.js' | ||
Specifies a path to jDebug client side library. | ||
### Usage Examples | ||
@@ -120,0 +133,0 @@ |
@@ -96,3 +96,5 @@ /* | ||
baseHref: '/' | ||
baseHref: '', | ||
jDebugEnabled: false, | ||
jDebugSrc: 'node_modules/jdebug/lib/jdebug.js' | ||
}); | ||
@@ -315,3 +317,3 @@ | ||
grunt.registerTask('jasperPackageStyles', function(){ | ||
grunt.registerTask('jasperPackageStyles', function () { | ||
if (!options.package) | ||
@@ -438,6 +440,6 @@ return; // execute on package process only | ||
packagedAreasPaths[area.name] = filename; | ||
runUglify= true; | ||
runUglify = true; | ||
} | ||
}); | ||
if(runUglify){ | ||
if (runUglify) { | ||
uglifyConf.dest = { | ||
@@ -623,3 +625,3 @@ files: uglifyFiles | ||
startupScript.minfilename = '_startup.' + (options.fileVersion ? startupMinVersion : '') + '.min.js'; | ||
startupScript.minpath = options.packageOutput + '/scripts/' + startupScript.minfilename ; | ||
startupScript.minpath = options.packageOutput + '/scripts/' + startupScript.minfilename; | ||
uglifyConf.jasperstartup = {files: {}}; | ||
@@ -640,6 +642,9 @@ uglifyConf.jasperstartup.files[startupScript.minpath] = startupScript.path; | ||
if (options.package) { | ||
scripts.push( packageScriptsReferencePath + baseScript.minfilename); | ||
scripts.push( packageScriptsReferencePath + startupScript.minfilename); | ||
scripts.push(packageScriptsReferencePath + baseScript.minfilename); | ||
scripts.push(packageScriptsReferencePath + startupScript.minfilename); | ||
} else { | ||
scripts = baseScripts.concat(startupScripts); | ||
if (options.jDebugEnabled) { | ||
scripts.push(options.jDebugSrc); | ||
} | ||
} | ||
@@ -646,0 +651,0 @@ |
@@ -33,14 +33,2 @@ 'use strict'; | ||
var processSystemPaths = function (path) { | ||
var config = getConfig(); | ||
var wildcards = { | ||
'%areas_config%': config.appPath + '/_areas.debug.js', | ||
'%values_config%': config.appPath + '/_values.debug.js', | ||
'%routes_config%': config.appPath + '/_routes.debug.js' | ||
}; | ||
if (wildcards[path]) { | ||
return wildcards[path]; | ||
} | ||
return path; | ||
}; | ||
@@ -62,7 +50,9 @@ var ensurePartsExistence = function (test, content, parts) { | ||
var scripts = this.config.baseScripts; | ||
scripts.push('node_modules/jdebug/lib/jdebug.js'); // jDebug script | ||
var indexPageContent = grunt.file.read(path.join(appPath, 'index.html')); | ||
scripts.forEach(function (path) { | ||
var scriptReferenceText = '<script src="/' + processSystemPaths(path) + '"></script>'; | ||
test.ok(indexPageContent.indexOf(scriptReferenceText) >= 0, 'Page content must contain ' + processSystemPaths(path) + ' reference'); | ||
var scriptReferenceText = '<script src="' + path + '"></script>'; | ||
test.ok(indexPageContent.indexOf(scriptReferenceText) >= 0, 'Page content must contain ' + path + ' reference'); | ||
}); | ||
@@ -78,3 +68,3 @@ | ||
styles.forEach(function (path) { | ||
parts.push('<link rel="stylesheet" href="/' + path + '"/>'); | ||
parts.push('<link rel="stylesheet" href="' + path + '"/>'); | ||
}); | ||
@@ -81,0 +71,0 @@ ensurePartsExistence(test, indexPageContent, parts); |
Sorry, the diff of this file is not supported yet
60299
189
1393