diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-08-12 12:42:36 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2018-08-12 16:09:36 +0200 |
commit | 6e5548ef9a522dfc9705d552a7444eeb613ac31f (patch) | |
tree | 80fd092d1cdb6eebec197d768b8f11f8f9f4e531 /Rakefile | |
parent | 3e3d1cc187282102ad2e8484122a7838724a52d3 (diff) |
Add special API for JS, don't register implicitly after require
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 |