md2essay/Rakefile
Christian Genco 669a78990f mvp complete
2015-04-06 22:27:29 -05:00

18 lines
462 B
Ruby

require 'uglifier'
task default: %w[build]
task :build do
# puts system("browserify -t coffeeify browser.app.coffee > js/markdowntomla.js")
html = File.read('index.html')
bundled = html.split("\n").map{|line|
if line =~ /\<script.*src=\"(.*)\"/
path = $1
js = Uglifier.compile(File.read(path))
"<script type='text/javascript'>#{js}</script>"
else
line
end
}
File.open('index.min.html', 'w'){|f| f.puts bundled}
end