无法使用美元符号创build独立的browserify模块
尝试浏览以下模块:
module.exports = function () { return 'test'; };
使用--standalone
选项和一个包含$
字符的独立模块
./node_modules/.bin/browserify src.js --s '$money' > foo.js
结果在全球出口money
而不是$money
:
f.money=e()
$
是一个有效的variables/属性名称,所以我怎样才能得到browserify导出它呢? 这似乎不是由于壳逃脱,但是,浏览/ esprima正在做的事情。
我现在不能真正debugging它,但它看起来像它发生在ForbesLindesay / umd index.is:57 …
name.replace(/[^a-zA-Z0-9]+/g, '')
…和许多关于浏览器的东西一样,没有logging。 但公平地说,它似乎没有被UMD本身logging。