lrGeneratorMixin.generateCommonJSModule generates some code that is intended to run in a CommonJS environment, within which it takes for granted that Node’s fs and path will be available. This may not necessarily be the case, as is demonstrated in https://github.com/jashkenas/coffeescript/issues/4391. We should simply check that require('fs') and require('path') are defined before we try to use them.
lrGeneratorMixin.generateCommonJSModule
generates some code that is intended to run in a CommonJS environment, within which it takes for granted that Node’sfs
andpath
will be available. This may not necessarily be the case, as is demonstrated in https://github.com/jashkenas/coffeescript/issues/4391. We should simply check thatrequire('fs')
andrequire('path')
are defined before we try to use them.