mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
make compatible with Broswerify
Browserify implements a subset of the fs module, so the current check passes, but it does not support readdirSync, so that call fails.
This commit is contained in:
parent
2e102c72b2
commit
4cb9c0cbef
|
@ -120,7 +120,7 @@ var g_output_modifiers = [];
|
|||
if (typeof module !== 'undefind' && typeof exports !== 'undefined' && typeof require !== 'undefind') {
|
||||
var fs = require('fs');
|
||||
|
||||
if (fs) {
|
||||
if (fs && fs.readdirSync) {
|
||||
// Search extensions folder
|
||||
var extensions = fs.readdirSync((__dirname || '.')+'/extensions').filter(function(file){
|
||||
return ~file.indexOf('.js');
|
||||
|
|
Loading…
Reference in New Issue
Block a user