Browse Source

add browserify grunt task

Robin Herbots 10 years ago
parent
commit
f1e8c5ff78
7 changed files with 27 additions and 2638 deletions
  1. 1 0
      .eslintrc
  2. 9 0
      Gruntfile.js
  3. 11 2
      README.md
  4. 0 2621
      dist/jquery.inputmask.bundle.js
  5. 0 12
      dist/min/jquery.inputmask.bundle.min.js
  6. 3 0
      package.json
  7. 3 3
      qunit/main.js

+ 1 - 0
.eslintrc

@@ -40,6 +40,7 @@
     "jQuery": false,
     "module": false,
     "require": false,
+    "requirejs": false,
     "define": false
   }
 }

+ 9 - 0
Gruntfile.js

@@ -108,6 +108,15 @@ module.exports = function(grunt) {
 					showTasks: ['user']
 				}
 			}
+		},
+		browserify: { /* not working */
+			dist: {
+				dest: 'build/jquery.inputmask.bundle.js',
+				src: [],
+				options: {
+					require: ["./"]
+				}
+			}
 		}
 	});
 

+ 11 - 2
README.md

@@ -32,8 +32,6 @@ Demo page see [http://robinherbots.github.io/jquery.inputmask](http://robinherbo
 ## Usage:
 Include the js-files which you can find in the dist-folder.
 
-If you use a module loader like requireJS, use the js-files in dist/inputmask
-
 The minimum to include is inputmask.js && jquery.inputmask.js
 
 ```html
@@ -42,6 +40,17 @@ The minimum to include is inputmask.js && jquery.inputmask.js
 <script src="jquery.inputmask.js" type="text/javascript"></script>
 ```
 
+If you use a module loader like requireJS, use the js-files in dist/inputmask
+
+```javascript
+paths: {
+  ...
+  "dependencyLib": "../dist/inputmask/dependencyLib",
+  "inputmask": "../dist/inputmask/inputmask",
+  ...
+}
+```
+
 Define your masks:
 
 ```javascript

File diff suppressed because it is too large
+ 0 - 2621
dist/jquery.inputmask.bundle.js


File diff suppressed because it is too large
+ 0 - 12
dist/min/jquery.inputmask.bundle.min.js


+ 3 - 0
package.json

@@ -36,8 +36,11 @@
     "jquery": ">=1.7"
   },
   "devDependencies": {
+    "browserify": "^11.1.0",
+    "browserify-shim": "^3.8.10",
     "grunt": "^0.4.5",
     "grunt-available-tasks": "^0.6.0",
+    "grunt-browserify": "^4.0.1",
     "grunt-bump": "^0.3.0",
     "grunt-contrib-clean": "^0.6.0",
     "grunt-contrib-uglify": "^0.9.1",

+ 3 - 3
qunit/main.js

@@ -1,13 +1,13 @@
 define([
 	"qunit",
-	"prototypeExtensions",
-	"simulator",
 	"../dist/inputmask/inputmask.date.extensions",
 	"../dist/inputmask/inputmask.extensions",
 	"../dist/inputmask/inputmask.numeric.extensions",
 	"../dist/inputmask/inputmask.phone.extensions",
 	"../dist/inputmask/inputmask.regex.extensions",
-	"../dist/inputmask/jquery.inputmask"
+	"../dist/inputmask/jquery.inputmask",
+	"prototypeExtensions",
+	"simulator"
 ], function(qunit) {
 	// start QUnit.
 	qunit.load();