Tag: shim

如何为React Native修补/填充crypto.getRandomValues

我使用ReactNativify将一些为NodeJS创build的包移植到React Native,以将Node API对象依赖项重写为他们的browserify等价物。 其中之一是crypto 。 在transformer.js (或.babelrc )中我有: // The following plugin will rewrite imports. Reimplementations of node // libraries such as `assert`, `buffer`, etc. will be picked up // automatically by the React Native packager. All other built-in node // libraries get rewritten to their browserify counterpart. [require('babel-plugin-rewrite-require'), { aliases: { crypto: 'crypto-browserify', // […]

如何在webpack中填充tinymce?

我试图让webpack认可tinymce 。 它在window上设置了一个名为tinymce的属性,所以显然有一个select是使用这样的语法来require()它(在webpack文档的EXPORTING 部分的底部描述): require("imports?window=>{}!exports?window.XModule!./file.js 但在这个例子中,./ ./file.js是./file.js解决的? 我通过npm安装了tinymce,我不知道如何指定tinymce.js文件的正确path。 无论如何,我宁愿在我的configuration中处理这个,只要可能就require('tinymce') ,所以我已经安装了exports-loader并在configuration中添加了以下内容(基于这个讨论 ): module: { loaders: [ { test: /[\/]tinymce\.js$/, loader: 'exports?tinymce' } ] } 不幸的是,这是行不通的。 我的configuration有什么问题?