Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

AMD support

Added amd.js to concat and uglify tasks

Added AMD support and amd.js file to Grunt concat task
  • Loading branch information...
commit d8c418e99eadbd4b584a52116503cf8d04f7f12b 1 parent 95be3c1
@medimatrix medimatrix authored medimatrix committed
Showing with 7 additions and 2 deletions.
  1. +2 −2 Gruntfile.js
  2. +5 −0 src/amd.js
View
4 Gruntfile.js
@@ -9,7 +9,7 @@ module.exports = function(grunt) {
concat: {
options: {},
dist: {
- src: ['src/node.js', 'src/priorityqueue.js', 'src/instance.js', 'src/easystar.js'],
+ src: ['src/node.js', 'src/priorityqueue.js', 'src/instance.js', 'src/easystar.js', 'src/amd.js'],
dest: '',
}
},
@@ -37,7 +37,7 @@ module.exports = function(grunt) {
var releaseFilename = "bin/easystar-" + grunt.file.readJSON('package.json').version + ".min.js";
var files = {};
- files[releaseFilename] = ['src/node.js', 'src/priorityqueue.js', 'src/instance.js', 'src/easystar.js'];
+ files[releaseFilename] = ['src/node.js', 'src/priorityqueue.js', 'src/instance.js', 'src/easystar.js', 'src/amd.js'];
grunt.config.set('uglify.release.files',files)
grunt.config.set('concat.dist.dest', "bin/easystar-" + grunt.file.readJSON('package.json').version + ".js")
View
5 src/amd.js
@@ -0,0 +1,5 @@
+if (typeof define === "function" && define.amd) {
+ define("easystar", [], function() {
+ return EasyStar;
+ });
+}
Please sign in to comment.
Something went wrong with that request. Please try again.