Sha256: 2665c2fe2bdc4daab2cb8fc47e77cfaaa02a5aea32dbf8f60a01cca84f8f5d81
Contents?: true
Size: 700 Bytes
Versions: 7
Compression:
Stored size: 700 Bytes
Contents
module Hyperloop class << self def js_import(value, client_only: nil, server_only: nil, defines:) defines = [*defines] if RUBY_ENGINE != 'opal' import(value, client_only: client_only, server_only: server_only, js_import: true) else on_server = `typeof Opal.global.document === 'undefined'` return if (server_only && !on_server) || (client_only && on_server) defines.each do |name| next unless `Opal.global[#{name}] === undefined` raise "The package #{name} was not found. Add it to the webpack "\ "#{client_only ? 'client_only.js' : 'client_and_server.js'} manifest." end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems