diff options
author | wout <wout@impinc.co.uk> | 2014-09-05 17:15:38 +0200 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-09-05 17:15:46 +0200 |
commit | 4c0921cbb1c6e0d6a3959455780c2c1a8a50d27c (patch) | |
tree | 0fd6abffc2fe4b38d751f3be86be598bfbb81a74 /Rakefile | |
parent | a0f3ae47fb9c249521aa5a3b5a327cb2faecea38 (diff) | |
download | svg.js-4c0921cbb1c6e0d6a3959455780c2c1a8a50d27c.tar.gz svg.js-4c0921cbb1c6e0d6a3959455780c2c1a8a50d27c.zip |
Added UMD wrapper1.0.1
Diffstat (limited to 'Rakefile')
-rwxr-xr-x | Rakefile | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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 |