Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sprockets-commonjs for non rails environment, related to #19 #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/sprockets/commonjs/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ class Engine < ::Rails::Engine

end
end
end
else
module Sprockets
register_postprocessor 'application/javascript', CommonJS
append_path File.expand_path('../../../assets/javascripts', __FILE__)
end
end
1 change: 0 additions & 1 deletion test/sprockets_commonjs_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class SprocketsCommonjsTest < Test::Unit::TestCase

def setup
env = Sprockets::Environment.new
env.register_postprocessor 'application/javascript', Sprockets::CommonJS
env.append_path TEST_DIR
env.append_path LIB_DIR
outfile = Tempfile.new('sprockets-output')
Expand Down