@umijs/preset-vue 4.0.8 → 4.0.11
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.
- package/dist/constants.js +1 -1
- package/dist/features/config/assetRules.js +2 -7
- package/dist/features/config/config.js +1 -1
- package/dist/features/default.js +13 -11
- package/dist/features/tmpFiles/tmpFiles.js +1 -1
- package/dist/features/vite/vite.js +1 -1
- package/dist/features/vueBabelLoaderCustomize.d.ts +4 -0
- package/dist/features/vueBabelLoaderCustomize.js +43 -0
- package/dist/features/webpack.js +1 -1
- package/dist/index.js +1 -1
- package/dist/requireHook.js +2 -3
- package/dist/utils/resolveProjectDep.d.ts +5 -0
- package/dist/utils/resolveProjectDep.js +16 -3
- package/package.json +5 -5
package/dist/constants.js
CHANGED
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// constants.ts
|
|
19
|
+
// src/constants.ts
|
|
20
20
|
var constants_exports = {};
|
|
21
21
|
__export(constants_exports, {
|
|
22
22
|
TEMPLATES_DIR: () => TEMPLATES_DIR
|
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// assetRules.ts
|
|
19
|
+
// src/features/config/assetRules.ts
|
|
20
20
|
var assetRules_exports = {};
|
|
21
21
|
__export(assetRules_exports, {
|
|
22
22
|
addAssetRules: () => addAssetRules
|
|
@@ -26,20 +26,15 @@ async function addAssetRules({ config, api }) {
|
|
|
26
26
|
config.module.rules.delete("asset");
|
|
27
27
|
const { userConfig } = api;
|
|
28
28
|
const inlineLimit = parseInt(userConfig.inlineLimit || "10000", 10);
|
|
29
|
-
const staticPathPrefix = api.config.staticPathPrefix !== void 0 ? api.config.staticPathPrefix : "static/";
|
|
30
29
|
config.module.rule("avif").test(/\.avif$/).type("asset").mimetype("image/avif").parser({
|
|
31
30
|
dataUrlCondition: {
|
|
32
31
|
maxSize: inlineLimit
|
|
33
32
|
}
|
|
34
|
-
}).generator({
|
|
35
|
-
filename: `${staticPathPrefix}[name].[hash:8].[ext]`
|
|
36
33
|
});
|
|
37
|
-
config.module.rule("image").test(/\.(bmp|gif|jpg|jpeg|png)$/).type("asset").parser({
|
|
34
|
+
config.module.rule("image").test(/\.(bmp|gif|jpg|jpeg|png|svg)$/).type("asset").parser({
|
|
38
35
|
dataUrlCondition: {
|
|
39
36
|
maxSize: inlineLimit
|
|
40
37
|
}
|
|
41
|
-
}).generator({
|
|
42
|
-
filename: `${staticPathPrefix}[name].[hash:8].[ext]`
|
|
43
38
|
});
|
|
44
39
|
}
|
|
45
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
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));
|
|
20
20
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
21
|
|
|
22
|
-
// config.ts
|
|
22
|
+
// src/features/config/config.ts
|
|
23
23
|
var config_exports = {};
|
|
24
24
|
__export(config_exports, {
|
|
25
25
|
getConfig: () => getConfig
|
package/dist/features/default.js
CHANGED
|
@@ -36,7 +36,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
36
36
|
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));
|
|
37
37
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
38
|
|
|
39
|
-
// default.ts
|
|
39
|
+
// src/features/default.ts
|
|
40
40
|
var default_exports = {};
|
|
41
41
|
__export(default_exports, {
|
|
42
42
|
default: () => default_default
|
|
@@ -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)({
|
|
@@ -76,6 +76,8 @@ var default_default = (api) => {
|
|
|
76
76
|
});
|
|
77
77
|
api.modifyConfig((memo) => {
|
|
78
78
|
memo.fastRefresh = false;
|
|
79
|
+
memo.babelLoaderCustomize = require.resolve("./vueBabelLoaderCustomize");
|
|
80
|
+
memo.svgr = false;
|
|
79
81
|
return memo;
|
|
80
82
|
});
|
|
81
83
|
api.modifyAppData((memo) => {
|
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// tmpFiles.ts
|
|
19
|
+
// src/features/tmpFiles/tmpFiles.ts
|
|
20
20
|
var tmpFiles_exports = {};
|
|
21
21
|
__export(tmpFiles_exports, {
|
|
22
22
|
default: () => tmpFiles_default
|
|
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
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));
|
|
20
20
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
21
|
|
|
22
|
-
// vite.ts
|
|
22
|
+
// src/features/vite/vite.ts
|
|
23
23
|
var vite_exports = {};
|
|
24
24
|
__export(vite_exports, {
|
|
25
25
|
default: () => vite_default
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/features/vueBabelLoaderCustomize.ts
|
|
20
|
+
var vueBabelLoaderCustomize_exports = {};
|
|
21
|
+
__export(vueBabelLoaderCustomize_exports, {
|
|
22
|
+
default: () => vueBabelLoaderCustomize
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(vueBabelLoaderCustomize_exports);
|
|
25
|
+
var import_querystring = require("querystring");
|
|
26
|
+
function vueBabelLoaderCustomize() {
|
|
27
|
+
return {
|
|
28
|
+
config(config) {
|
|
29
|
+
const context = this;
|
|
30
|
+
if (config.options.filename) {
|
|
31
|
+
if (/\.vue$/.test(config.options.filename)) {
|
|
32
|
+
const query = (0, import_querystring.parse)(context.resourceQuery.slice(1));
|
|
33
|
+
if (query.type === "template") {
|
|
34
|
+
config.options.filename = `${config.options.filename}?type=${query.type}`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return config.options;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {});
|
package/dist/features/webpack.js
CHANGED
|
@@ -33,7 +33,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
33
33
|
};
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
-
// webpack.ts
|
|
36
|
+
// src/features/webpack.ts
|
|
37
37
|
var webpack_exports = {};
|
|
38
38
|
__export(webpack_exports, {
|
|
39
39
|
default: () => webpack_default
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
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));
|
|
20
20
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
21
|
|
|
22
|
-
// index.ts
|
|
22
|
+
// src/index.ts
|
|
23
23
|
var src_exports = {};
|
|
24
24
|
__export(src_exports, {
|
|
25
25
|
default: () => src_default
|
package/dist/requireHook.js
CHANGED
|
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target, mod2));
|
|
20
20
|
var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);
|
|
21
21
|
|
|
22
|
-
// requireHook.ts
|
|
22
|
+
// src/requireHook.ts
|
|
23
23
|
var requireHook_exports = {};
|
|
24
24
|
__export(requireHook_exports, {
|
|
25
25
|
hookPropertyMap: () => hookPropertyMap
|
|
@@ -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();
|
|
@@ -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
|
-
// resolveProjectDep.ts
|
|
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.
|
|
3
|
+
"version": "4.0.11",
|
|
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",
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
"compiled"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "
|
|
20
|
+
"build": "umi-scripts father build",
|
|
21
21
|
"build:deps": "umi-scripts bundleDeps",
|
|
22
|
-
"dev": "
|
|
22
|
+
"dev": "umi-scripts father dev"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@umijs/renderer-vue": "4.0.
|
|
25
|
+
"@umijs/renderer-vue": "4.0.11",
|
|
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.
|
|
32
|
+
"umi": "4.0.11"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|