index.js 1.1 KB

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.uniH5Plugin = void 0;
  4. const handleHotUpdate_1 = require("./handleHotUpdate");
  5. const transformIndexHtml_1 = require("./transformIndexHtml");
  6. const configureServer_1 = require("./configureServer");
  7. const uni_1 = require("./uni");
  8. const polyfill_1 = require("./polyfill");
  9. const config_1 = require("./config");
  10. function uniH5Plugin() {
  11. const configOptions = {
  12. resolvedConfig: null,
  13. };
  14. if (process.env.UNI_APP_X === 'true') {
  15. (0, polyfill_1.rewriteCompileScriptOnce)();
  16. }
  17. return {
  18. name: 'uni:h5',
  19. uni: (0, uni_1.createUni)(),
  20. config: (0, config_1.createConfig)(configOptions),
  21. configResolved(config) {
  22. configOptions.resolvedConfig = config;
  23. },
  24. configureServer: (0, configureServer_1.createConfigureServer)(),
  25. handleHotUpdate: (0, handleHotUpdate_1.createHandleHotUpdate)(),
  26. transformIndexHtml: (0, transformIndexHtml_1.createTransformIndexHtml)(),
  27. };
  28. }
  29. exports.uniH5Plugin = uniH5Plugin;