summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-08-12 12:42:36 +0200
committerJakub Jirutka <jakub@jirutka.cz>2018-08-12 16:09:36 +0200
commit6e5548ef9a522dfc9705d552a7444eeb613ac31f (patch)
tree80fd092d1cdb6eebec197d768b8f11f8f9f4e531 /Rakefile
parent3e3d1cc187282102ad2e8484122a7838724a52d3 (diff)
Add special API for JS, don't register implicitly after require
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Rakefile b/Rakefile
index bc86f92..54fd891 100644
--- a/Rakefile
+++ b/Rakefile
@@ -32,12 +32,15 @@ namespace :build do
dynamic_require_severity: :error,
})
builder.append_paths 'lib'
- builder.build 'asciidoctor-interdoc-reftext'
+ builder.build 'asciidoctor/interdoc_reftext'
out_file = 'js/asciidoctor-interdoc-reftext.js'
mkdir_p(File.dirname(out_file), verbose: false)
- File.binwrite out_file, builder.to_s
+ File.open(out_file, 'w') do |file|
+ template = File.read('src/asciidoctor-interdoc-reftext.tmpl.js')
+ file << template.sub('//OPAL-GENERATED-CODE//', builder.to_s)
+ end
File.binwrite "#{out_file}.map", builder.source_map
end
end