nvue.js 988 B

123456789101112131415161718192021222324
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.initNVueEnv = void 0;
  4. const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
  5. function initNVueEnv() {
  6. const manifestJson = (0, uni_cli_shared_1.parseManifestJsonOnce)(process.env.UNI_INPUT_DIR);
  7. if ((0, uni_cli_shared_1.getAppRenderer)(manifestJson) === 'native') {
  8. process.env.UNI_RENDERER = 'native';
  9. }
  10. const nvueCompiler = (0, uni_cli_shared_1.getNVueCompiler)(manifestJson);
  11. if (nvueCompiler === 'uni-app') {
  12. process.env.UNI_NVUE_COMPILER = 'uni-app';
  13. }
  14. else if (nvueCompiler === 'vue') {
  15. process.env.UNI_NVUE_COMPILER = 'vue';
  16. }
  17. if ((0, uni_cli_shared_1.getNVueStyleCompiler)(manifestJson) === 'uni-app') {
  18. process.env.UNI_NVUE_STYLE_COMPILER = 'uni-app';
  19. }
  20. if ((0, uni_cli_shared_1.getAppCodeSpliting)(manifestJson)) {
  21. process.env.UNI_APP_CODE_SPLITING = 'true';
  22. }
  23. }
  24. exports.initNVueEnv = initNVueEnv;