Class: Csso::Loader::ModifiedEnvironment

Inherits:
CommonJS::Environment
  • Object
show all
Defined in:
lib/csso/loader.rb

Instance Method Summary collapse

Instance Method Details

#require(module_id) ⇒ Object

CommonJS’ require does append .js to modules no matter if it is there already



12
13
14
15
16
# File 'lib/csso/loader.rb', line 12

def require module_id
  path = module_id.gsub(/^\.\//, "")
  path = path.gsub(/\.js$/, "")
  super path
end