@umijs/preset-vue 4.0.0-canary.20220729.2 → 4.0.0-canary.20220819.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,18 +48,18 @@ var default_default = (api) => {
48
48
  api.describe({
49
49
  key: "preset-vue:default"
50
50
  });
51
- const vuePath = (0, import_resolveProjectDep.resolveProjectDep)({
52
- pkg: api.pkg,
53
- cwd: api.cwd,
54
- dep: "vue/dist/vue.esm-bundler.js"
55
- }) || require.resolve("vue/dist/vue.esm-bundler.js");
56
- const vueRuntimePath = (0, import_resolveProjectDep.resolveProjectDep)({
57
- pkg: api.pkg,
58
- cwd: api.cwd,
59
- dep: "vue/dist/vue.runtime.esm-bundler.js"
60
- }) || require.resolve("vue/dist/vue.runtime.esm-bundler.js");
61
51
  api.modifyDefaultConfig((config) => {
62
52
  var _a;
53
+ const vuePath = (0, import_resolveProjectDep.resolveVuePath)({
54
+ pkg: api.pkg,
55
+ cwd: api.cwd,
56
+ path: "dist/vue.esm-bundler.js"
57
+ });
58
+ const vueRuntimePath = (0, import_resolveProjectDep.resolveVuePath)({
59
+ pkg: api.pkg,
60
+ cwd: api.cwd,
61
+ path: "dist/vue.runtime.esm-bundler.js"
62
+ });
63
63
  config.alias = __spreadProps(__spreadValues({}, config.alias), {
64
64
  vue: ((_a = api.userConfig.vue) == null ? void 0 : _a.runtimeCompiler) ? vuePath : vueRuntimePath,
65
65
  "vue-router": (0, import_resolveProjectDep.resolveProjectDep)({
@@ -32,8 +32,7 @@ var hookPropertyMap = /* @__PURE__ */ new Map([
32
32
  ["webpack/package.json", "@umijs/bundler-webpack/compiled/webpack/package"],
33
33
  ["webpack/lib/webpack", "@umijs/bundler-webpack/compiled/webpack"],
34
34
  ["webpack/lib/webpack.js", "@umijs/bundler-webpack/compiled/webpack"],
35
- ["tapable", "@umijs/bundler-utils/compiled/tapable"],
36
- ["vite", "@umijs/bundler-vite/compiled/vite"]
35
+ ["tapable", "@umijs/bundler-utils/compiled/tapable"]
37
36
  ]);
38
37
  import_deepImports.default.forEach((item) => {
39
38
  const name = item.split("/").pop();
@@ -3,3 +3,8 @@ export declare function resolveProjectDep(opts: {
3
3
  cwd: string;
4
4
  dep: string;
5
5
  }): string | undefined;
6
+ export declare function resolveVuePath(opts: {
7
+ pkg: any;
8
+ cwd: string;
9
+ path: string;
10
+ }): string;
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,12 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
17
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
21
 
19
22
  // src/utils/resolveProjectDep.ts
20
23
  var resolveProjectDep_exports = {};
21
24
  __export(resolveProjectDep_exports, {
22
- resolveProjectDep: () => resolveProjectDep
25
+ resolveProjectDep: () => resolveProjectDep,
26
+ resolveVuePath: () => resolveVuePath
23
27
  });
24
28
  module.exports = __toCommonJS(resolveProjectDep_exports);
25
29
  var import_path = require("path");
@@ -32,7 +36,16 @@ function resolveProjectDep(opts) {
32
36
  }));
33
37
  }
34
38
  }
39
+ function resolveVuePath(opts) {
40
+ const vuePkgPath = resolveProjectDep({
41
+ pkg: opts.pkg,
42
+ cwd: opts.cwd,
43
+ dep: "vue"
44
+ }) || (0, import_path.dirname)(require.resolve("vue/package.json"));
45
+ return (0, import_path.join)(vuePkgPath, opts.path);
46
+ }
35
47
  // Annotate the CommonJS export names for ESM import in node:
36
48
  0 && (module.exports = {
37
- resolveProjectDep
49
+ resolveProjectDep,
50
+ resolveVuePath
38
51
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/preset-vue",
3
- "version": "4.0.0-canary.20220729.2",
3
+ "version": "4.0.0-canary.20220819.1",
4
4
  "description": "@umijs/preset-vue",
5
5
  "homepage": "https://github.com/umijs/umi/tree/master/packages/preset-vue#readme",
6
6
  "bugs": "https://github.com/umijs/umi/issues",
@@ -22,14 +22,14 @@
22
22
  "dev": "umi-scripts father dev"
23
23
  },
24
24
  "dependencies": {
25
- "@umijs/renderer-vue": "4.0.0-canary.20220729.2",
25
+ "@umijs/renderer-vue": "4.0.0-canary.20220819.1",
26
26
  "vue": "3.2.36",
27
27
  "vue-loader": "17.0.0",
28
28
  "vue-router": "4.0.15"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@vitejs/plugin-vue": "2.3.1",
32
- "umi": "4.0.0-canary.20220729.2"
32
+ "umi": "4.0.0-canary.20220819.1"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"