index.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.uniAppPlugin = void 0;
  4. const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
  5. const uni_1 = require("./uni");
  6. const build_1 = require("./build");
  7. function uniAppPlugin({ renderer, appService, } = {
  8. appService: false,
  9. }) {
  10. return {
  11. name: 'uni:app',
  12. uni: (0, uni_1.uniOptions)(),
  13. config(config, env) {
  14. return {
  15. base: '/',
  16. build: (0, build_1.buildOptions)({ renderer, appService }, config, env),
  17. optimizeDeps: {
  18. disabled: true,
  19. },
  20. resolve: {
  21. alias: {
  22. // vue-i18n 默认会启用 new Function 来构造翻译函数,导致在 Android 上可能报`TypeError: no access` 错误
  23. // 故:启用 runtime 模式,内部定制了简易的 compileToFunction
  24. 'vue-i18n': (0, uni_cli_shared_1.resolveVueI18nRuntime)(),
  25. },
  26. },
  27. };
  28. },
  29. };
  30. }
  31. exports.uniAppPlugin = uniAppPlugin;