summaryrefslogtreecommitdiffstats
path: root/Rakefile
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-09-05 17:15:38 +0200
committerwout <wout@impinc.co.uk>2014-09-05 17:15:46 +0200
commit4c0921cbb1c6e0d6a3959455780c2c1a8a50d27c (patch)
tree0fd6abffc2fe4b38d751f3be86be598bfbb81a74 /Rakefile
parenta0f3ae47fb9c249521aa5a3b5a327cb2faecea38 (diff)
downloadsvg.js-4c0921cbb1c6e0d6a3959455780c2c1a8a50d27c.tar.gz
svg.js-4c0921cbb1c6e0d6a3959455780c2c1a8a50d27c.zip
Added UMD wrapper1.0.1
Diffstat (limited to 'Rakefile')
-rwxr-xr-xRakefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/Rakefile b/Rakefile
index 0341491..3dcefb4 100755
--- a/Rakefile
+++ b/Rakefile
@@ -54,11 +54,19 @@ BuildTask.define_task 'dist/svg.js' => MODULES.map {|m| "src/#{ m }.js" } do |ta
File.open(task.name, 'w') do |file|
file.puts "/* svg.js %s - %s - svgjs.com/license */" % [version_string, task.modules.join(' ')]
-
- file.puts ';(function() {'
+ file.puts ";(function(root, factory) {"
+ file.puts " if (typeof define === 'function' && define.amd) {"
+ file.puts " define(factory);"
+ file.puts " } else if (typeof exports === 'object') {"
+ file.puts " module.exports = factory();"
+ file.puts " } else {"
+ file.puts " root.SVG = factory();"
+ file.puts " }"
+ file.puts "}(this, function() {"
file.puts "\n"
file.puts svgjs
- file.puts '}).call(this);'
+ file.puts " return SVG"
+ file.puts "}));"
end
end