/**
 * Grunt-Replace
 * @description Replace inline patterns with variables.
 * @docs https://npmjs.org/package/grunt-replace
 */

var config = require("../Config");

module.exports = function(grunt) {
	"use strict";

	return {
		"init" : {
			"src" : [
				"**/*.php",
				"**/*.txt",
				"**/*.ts",
				"**/*.html",
				"**/*.scss",
				"!node_modules/**/*",
				"!" + config.JavaScripts.devDir + "/Libaries/**/*",
				"!" + config.JavaScripts.distDir + "/Libaries/**/*"
			],
			"overwrite" : true,
			"replacements" : [{
				"from" : "<!= pkg.name !>",
				"to" : config.package.name
			}, {
				"from" : "<!= pkg.description !>",
				"to" : config.package.description
			}, {
				"from" : "<!= pkg.homepage !>",
				"to" : config.package.homepage
			}, {
				"from" : "<!= pkg.version !>",
				"to" : config.package.version
			}, {
				"from" : "<!= pkg.author.name !>",
				"to" : config.package.author.name
			}, {
				"from" : "<!= pkg.author.email !>",
				"to" : config.package.author.email
			}, {
				"from" : "<!= date !>",
				"to" : grunt.template.today("dd-mm-yyyy hh:MM")
			}]
		},
		"deploy" : {
			"src" : [config.paths.private + "/Layouts/*.html"],
			"overwrite" : true,
			"replacements" : [{
				"from" : "<%= modernizr.devFile %>",
				"to" : "<%= modernizr.outputFile %>"
			}]
		},
		"dev" : {
			"src" : [config.paths.private + "/Layouts/*.html"],
			"overwrite" : true,
			"replacements" : [{
				"from" : "<%= modernizr.outputFile %>",
				"to" : "<%= modernizr.devFile %>"
			}]
		}
	};
};

@@ -1214,37 +1214,51 @@
 %5B%7B%0A%09%09%09%09%22from%22 : 
-%22%3C%25= 
+config.JavaScripts.
 modernizr.devFil
@@ -1254,24 +1254,26 @@
 nizr.dev
+Source
 File
- %25%3E%22
 ,%0A%09%09%09%09%22t
@@ -1269,37 +1269,51 @@
 ile,%0A%09%09%09%09%22to%22 : 
-%22%3C%25= 
+config.JavaScripts.
 modernizr.output
@@ -1306,30 +1306,29 @@
 dernizr.
-outpu
+buildDis
 tFile
- %25%3E%22
 %0A%09%09%09%7D%5D%0A%09

Fix the replacement of the modernizr source in the deploy task