File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 11"use strict" ;
22
33var Module = require ( "module" ) ,
4- fs = require ( "fs" ) ;
4+ fs = require ( "fs" ) ,
5+ coffee ;
56
67 // caching original wrapper
78var moduleWrapper0 = Module . wrapper [ 0 ] ,
@@ -55,8 +56,7 @@ function restoreExtensions() {
5556}
5657
5758function coffeeExtension ( module , filename ) {
58- var coffee = require ( "coffee-script" ) ,
59- content = stripBOM ( fs . readFileSync ( filename , "utf8" ) ) ;
59+ var content = stripBOM ( fs . readFileSync ( filename , "utf8" ) ) ;
6060
6161 content = coffee . compile ( content , {
6262 filename : filename ,
@@ -78,5 +78,11 @@ function stripBOM(content) {
7878 return content ;
7979}
8080
81+ try {
82+ coffee = require ( "coffee-script" ) ;
83+ } catch ( err ) {
84+ // We are not able to provide coffee-script support, but that's ok as long as the user doesn't want it.
85+ }
86+
8187exports . load = load ;
82- exports . inject = inject ;
88+ exports . inject = inject ;
You can’t perform that action at this time.
0 commit comments