browser-shim.js 487 B

12345678910111213141516171819202122
  1. 'use strict';
  2. exports.path = require('path').dirname(require.main.filename);
  3. exports.resolve = function(pathToModule) {
  4. return exports.path + pathToModule;
  5. };
  6. exports.require = function(pathToModule) {
  7. var r = 'function' === typeof __webpack_require__
  8. ? __non_webpack_require__
  9. : require;
  10. return r(exports.resolve(pathToModule));
  11. };
  12. exports.toString = function() {
  13. return exports.path;
  14. };
  15. exports.setPath = function(explicitlySetPath) {
  16. exports.path = explicitlySetPath;
  17. };