您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

WebpackMissingModule.js 650B

1234567891011121314151617181920
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const toErrorCode = err =>
  7. `var e = new Error(${JSON.stringify(err)}); e.code = 'MODULE_NOT_FOUND';`;
  8. exports.module = request =>
  9. `!(function webpackMissingModule() { ${exports.moduleCode(request)} }())`;
  10. exports.promise = request => {
  11. const errorCode = toErrorCode(`Cannot find module '${request}'`);
  12. return `Promise.reject(function webpackMissingModule() { ${errorCode} return e; }())`;
  13. };
  14. exports.moduleCode = request => {
  15. const errorCode = toErrorCode(`Cannot find module '${request}'`);
  16. return `${errorCode} throw e;`;
  17. };