@dcloudio/uni-cli-shared 3.0.0-alpha-3021320211117002 → 3.0.0-alpha-3021320211118001
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/hbx/log.d.ts +2 -0
- package/dist/hbx/log.js +27 -1
- package/dist/logs/format.js +2 -0
- package/dist/mp/template.d.ts +4 -1
- package/dist/utils.js +1 -1
- package/dist/vite/plugins/vitejs/plugins/css.js +6 -5
- package/package.json +3 -3
package/dist/hbx/log.d.ts
CHANGED
|
@@ -3,4 +3,6 @@ export declare const h5ServeFormatter: Formatter;
|
|
|
3
3
|
export declare const removeInfoFormatter: Formatter;
|
|
4
4
|
export declare const removeWarnFormatter: Formatter;
|
|
5
5
|
export declare const FilenameFormatter: Formatter;
|
|
6
|
+
export declare const VueFilenameFormatter: Formatter;
|
|
6
7
|
export declare const HBuilderXFileFormatter: Formatter;
|
|
8
|
+
export declare const HBuilderXVueFileFormatter: Formatter;
|
package/dist/hbx/log.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HBuilderXFileFormatter = exports.FilenameFormatter = exports.removeWarnFormatter = exports.removeInfoFormatter = exports.h5ServeFormatter = void 0;
|
|
6
|
+
exports.HBuilderXVueFileFormatter = exports.HBuilderXFileFormatter = exports.VueFilenameFormatter = exports.FilenameFormatter = exports.removeWarnFormatter = exports.removeInfoFormatter = exports.h5ServeFormatter = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const utils_1 = require("../utils");
|
|
9
9
|
const SIGNAL_H5_LOCAL = ' > Local:';
|
|
@@ -65,6 +65,17 @@ exports.FilenameFormatter = {
|
|
|
65
65
|
});
|
|
66
66
|
},
|
|
67
67
|
};
|
|
68
|
+
const vueFileRE = /file:\s(.*)\?vue&type=(.*)/;
|
|
69
|
+
exports.VueFilenameFormatter = {
|
|
70
|
+
test(msg) {
|
|
71
|
+
return vueFileRE.test(msg);
|
|
72
|
+
},
|
|
73
|
+
format(msg) {
|
|
74
|
+
return msg.replace(vueFileRE, (_, filename) => {
|
|
75
|
+
return `file: ${filename.split('?')[0]}`;
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
};
|
|
68
79
|
exports.HBuilderXFileFormatter = {
|
|
69
80
|
test(msg) {
|
|
70
81
|
return fileRE.test(msg);
|
|
@@ -83,3 +94,18 @@ exports.HBuilderXFileFormatter = {
|
|
|
83
94
|
}));
|
|
84
95
|
},
|
|
85
96
|
};
|
|
97
|
+
exports.HBuilderXVueFileFormatter = {
|
|
98
|
+
test(msg) {
|
|
99
|
+
return vueFileRE.test(msg);
|
|
100
|
+
},
|
|
101
|
+
format(msg) {
|
|
102
|
+
return (msg
|
|
103
|
+
// remove color
|
|
104
|
+
.replace(/\x1B[[(?);]{0,2}(;?\d)*./g, '')
|
|
105
|
+
.replace(vueFileRE, (_, filename) => {
|
|
106
|
+
return ('at ' +
|
|
107
|
+
(0, utils_1.normalizePath)(path_1.default.relative(process.env.UNI_INPUT_DIR, filename)) +
|
|
108
|
+
':1');
|
|
109
|
+
}));
|
|
110
|
+
},
|
|
111
|
+
};
|
package/dist/logs/format.js
CHANGED
|
@@ -14,9 +14,11 @@ const initErrFormattersOnce = (0, uni_shared_1.once)(() => {
|
|
|
14
14
|
}
|
|
15
15
|
if ((0, env_1.runByHBuilderX)()) {
|
|
16
16
|
errFormatters.push(log_1.HBuilderXFileFormatter);
|
|
17
|
+
errFormatters.push(log_1.HBuilderXVueFileFormatter);
|
|
17
18
|
}
|
|
18
19
|
else {
|
|
19
20
|
errFormatters.push(log_1.FilenameFormatter);
|
|
21
|
+
errFormatters.push(log_1.VueFilenameFormatter);
|
|
20
22
|
}
|
|
21
23
|
});
|
|
22
24
|
const initInfoFormattersOnce = (0, uni_shared_1.once)(() => {
|
package/dist/mp/template.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ export interface MiniProgramCompilerOptions {
|
|
|
4
4
|
* 需要延迟渲染的组件,通常是某个组件的某个事件会立刻触发,需要延迟到首次 render 之后,比如微信 editor 的 ready 事件,快手 switch 的 change
|
|
5
5
|
*/
|
|
6
6
|
lazyElement?: {
|
|
7
|
-
[name: string]:
|
|
7
|
+
[name: string]: {
|
|
8
|
+
name: 'on' | 'bind';
|
|
9
|
+
arg: string[];
|
|
10
|
+
}[];
|
|
8
11
|
};
|
|
9
12
|
event?: {
|
|
10
13
|
format(name: string, opts: {
|
package/dist/utils.js
CHANGED
|
@@ -116,7 +116,7 @@ const NODE_MODULES_REGEX = /(\.\.\/)?node_modules/g;
|
|
|
116
116
|
function normalizeNodeModules(str) {
|
|
117
117
|
str = normalizePath(str).replace(NODE_MODULES_REGEX, 'node-modules');
|
|
118
118
|
// HBuilderX 内置模块路径转换
|
|
119
|
-
str = str.replace(/.*\/plugins\/uniapp-cli\/node[-_]modules/, 'node-modules');
|
|
119
|
+
str = str.replace(/.*\/plugins\/uniapp-cli-vite\/node[-_]modules/, 'node-modules');
|
|
120
120
|
if (process.env.UNI_PLATFORM === 'mp-alipay') {
|
|
121
121
|
str = str.replace('node-modules/@', 'node-modules/npm-scope-');
|
|
122
122
|
}
|
|
@@ -165,15 +165,16 @@ function cssPostPlugin(config, { chunkCssFilename, chunkCssCode, }) {
|
|
|
165
165
|
}
|
|
166
166
|
// resolve asset URL placeholders to their built file URLs and perform
|
|
167
167
|
// minification if necessary
|
|
168
|
-
const processChunkCSS = async (css, {
|
|
168
|
+
const processChunkCSS = async (css, { filename, inlined, minify, }) => {
|
|
169
169
|
// replace asset url references with resolved url.
|
|
170
170
|
css = css.replace(asset_1.assetUrlRE, (_, fileHash, postfix = '') => {
|
|
171
|
-
return (0, utils_1.normalizePath)(path_1.default.relative(dirname, (0, asset_1.getAssetFilename)(fileHash, config) + postfix));
|
|
171
|
+
return (0, utils_1.normalizePath)(path_1.default.relative(path_1.default.dirname(filename), (0, asset_1.getAssetFilename)(fileHash, config) + postfix));
|
|
172
172
|
});
|
|
173
173
|
if (minify && config.build.minify) {
|
|
174
174
|
css = await minifyCSS(css, config);
|
|
175
175
|
}
|
|
176
|
-
|
|
176
|
+
// 压缩后再处理,小程序平台会补充 @import nvue 代码,esbuild 的压缩会把 `@import "./nvue.css";` 的空格移除,变成 `@import"./nvue.css";` 在支付宝小程序中不支持
|
|
177
|
+
return chunkCssCode(filename, css);
|
|
177
178
|
};
|
|
178
179
|
const genCssCode = (fileName) => {
|
|
179
180
|
return [...cssChunks.get(fileName)]
|
|
@@ -182,8 +183,8 @@ function cssPostPlugin(config, { chunkCssFilename, chunkCssCode, }) {
|
|
|
182
183
|
};
|
|
183
184
|
for (const filename of cssChunks.keys()) {
|
|
184
185
|
const cssCode = genCssCode(filename);
|
|
185
|
-
let source = await processChunkCSS(
|
|
186
|
-
|
|
186
|
+
let source = await processChunkCSS(cssCode, {
|
|
187
|
+
filename: filename,
|
|
187
188
|
inlined: false,
|
|
188
189
|
minify: true,
|
|
189
190
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "3.0.0-alpha-
|
|
3
|
+
"version": "3.0.0-alpha-3021320211118001",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/parser": "^7.15.0",
|
|
22
22
|
"@babel/types": "^7.15.0",
|
|
23
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
24
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
23
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3021320211118001",
|
|
24
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211118001",
|
|
25
25
|
"@rollup/pluginutils": "^4.1.1",
|
|
26
26
|
"@vue/compiler-core": "3.2.22",
|
|
27
27
|
"@vue/compiler-dom": "3.2.22",
|