Skip to content

Commit

Permalink
This commit fixes Knockout-Contrib#342 issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergiy Stotskiy committed Oct 23, 2013
1 parent accc695 commit e48950d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
6 changes: 5 additions & 1 deletion Src/ko.validation.start.frag
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@
if (typeof (ko) === undefined) { throw 'Knockout is required, please ensure it is loaded before loading this validation plug-in'; }

// create our namespace object
ko.validation = exports;
ko.validation = exports;

var kv = ko.validation;
var koUtils = ko.utils;
var unwrap = koUtils.unwrapObservable;
39 changes: 23 additions & 16 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,52 @@ module.exports = function (grunt) {
concat: {
options: {
separator: ";",
banner: "<%= meta.banner %>"
banner: "<%= meta.banner %>",
process: function (src, filepath) {
return src
.replace(/ko\.validation\./g, 'kv.')
.replace(/ko\.utils\.unwrapObservable/g, 'unwrap')
.replace(/ko\.utils\./g, 'koUtils.');
}
},
dist: {
src: [
"<%= meta.banner %>",
"src/ko.validation.start.frag",
"src/configuration.js",
"src/utils.js",
"src/api.js",
"src/rules.js",
"src/bindingHandlers.js",
"src/extenders.js",
"src/localization.js",
"src/ko.extensions.js",
"src/ko.validation.end.frag",
"Src/ko.validation.start.frag",
"Src/configuration.js",
"Src/utils.js",
"Src/api.js",
"Src/rules.js",
"Src/bindingHandlers.js",
"Src/extenders.js",
"Src/localization.js",
"Src/ko.extensions.js",
"Src/ko.validation.end.frag",
],
dest: "dist/<%= pkg.name %>.js"
dest: "Dist/<%= pkg.name %>.js"
}
},
uglify: {
options: {
banner: "<%= meta.banner %>"
banner: "<%= meta.banner %>",
report: "min"
},
dist: {
files: {
"dist/<%= pkg.name %>.min.js": ["<%= concat.dist.dest %>"]
"Dist/<%= pkg.name %>.min.js": ["<%= concat.dist.dest %>"]
}
}
},
qunit: {
files: ["Tests/test-runner.htm"]
},
jshint: {
files: ["src/**/*.js", "Tests/*.js"],
files: ["Src/**/*.js", "Tests/*.js"],
options: grunt.file.readJSON(".jshintrc"),
},
watch: {
clear: {
files: ["src/**/*.js", "Tests/*.js"],
files: ["Src/**/*.js", "Tests/*.js"],
tasks: ["clear", "test"]
}
}
Expand Down

0 comments on commit e48950d

Please sign in to comment.