Sha256: 09e0134449c0128d67e58b9bbd5d60a469a5f454f2c53f6f05f94d407ca50ac5

Contents?: true

Size: 541 Bytes

Versions: 2

Compression:

Stored size: 541 Bytes

Contents

require 'haml'
require 'opal-sprockets'

module Opal
  module Haml
    class Processor < ::Opal::Sprockets::Processor
      def call
        @data = Opal::Haml.compile_haml @data, context.logical_path.sub(/#{Opal::REGEXP_START}templates\//, '')
        super
      end
    end
  end
end

Sprockets.register_mime_type 'application/html+haml', extensions: ['.haml', '.html.haml']
Sprockets.register_transformer 'application/html+haml', 'application/javascript', Opal::Haml::Processor
Opal::Sprockets.register_mime_type 'application/html+haml'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
opal-haml-0.5.1 lib/opal/haml/processor.rb
opal-haml-0.5.0 lib/opal/haml/processor.rb