@dcloudio/uni-cli-shared 3.0.0-alpha-4000020231215001 → 3.0.0-alpha-3090920231215001
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/utils.d.ts +2 -2
- package/dist/vite/plugins/uts/uvue.js +8 -11
- package/dist/vite/plugins/vitejs/plugins/asset.d.ts +1 -1
- package/dist/vite/plugins/vitejs/plugins/asset.js +2 -2
- package/dist/vite/plugins/vitejs/plugins/css.d.ts +1 -1
- package/dist/vite/plugins/vitejs/plugins/css.js +2 -2
- package/dist/vite/utils/plugin.d.ts +1 -1
- package/package.json +12 -12
package/dist/utils.d.ts
CHANGED
|
@@ -7,12 +7,12 @@ export declare let isRunningWithYarnPnp: boolean;
|
|
|
7
7
|
export declare const isWindows: boolean;
|
|
8
8
|
export declare function normalizePath(id: string): string;
|
|
9
9
|
export declare function checkElementNodeTag(node: RootNode | TemplateChildNode | null | undefined, tag: string): node is ElementNode;
|
|
10
|
-
export declare function normalizeIdentifier(str: string):
|
|
10
|
+
export declare function normalizeIdentifier(str: string): string;
|
|
11
11
|
export declare function normalizePagePath(pagePath: string, platform: UniApp.PLATFORM): string | undefined;
|
|
12
12
|
export declare function removeExt(str: string): string;
|
|
13
13
|
export declare function normalizeNodeModules(str: string): string;
|
|
14
14
|
export declare function normalizeMiniProgramFilename(filename: string, inputDir?: string): string;
|
|
15
|
-
export declare function normalizeParsePlugins(importer: string, babelParserPlugins?: ParserPlugin[]):
|
|
15
|
+
export declare function normalizeParsePlugins(importer: string, babelParserPlugins?: ParserPlugin[]): ParserPlugin[];
|
|
16
16
|
export declare function pathToGlob(pathString: string, glob: string, options?: {
|
|
17
17
|
windows?: boolean;
|
|
18
18
|
escape?: boolean;
|
|
@@ -19,17 +19,14 @@ function uniUTSUVueJavaScriptPlugin(options = {}) {
|
|
|
19
19
|
if (!(0, vue_1.isVueSfcFile)(id)) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
return {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}),
|
|
31
|
-
map: null,
|
|
32
|
-
};
|
|
22
|
+
return code.replace(/<script([^>]*)>/gi, (match, attributes) => {
|
|
23
|
+
// 如果 <script> 标签中没有 lang 属性,添加 lang="uts"
|
|
24
|
+
if (!/lang=["']?[^"']*["']?/.test(attributes)) {
|
|
25
|
+
return `<script${attributes} lang="uts">`;
|
|
26
|
+
}
|
|
27
|
+
// 否则,将现有的 lang 属性替换为 lang="uts"
|
|
28
|
+
return match.replace(/lang=["']?ts["']?/, 'lang="uts"');
|
|
29
|
+
});
|
|
33
30
|
},
|
|
34
31
|
};
|
|
35
32
|
}
|
|
@@ -8,7 +8,7 @@ export declare const chunkToEmittedAssetsMap: WeakMap<RenderedChunk, Set<string>
|
|
|
8
8
|
* Also supports loading plain strings with import text from './foo.txt?raw'
|
|
9
9
|
*/
|
|
10
10
|
export declare function assetPlugin(config: ResolvedConfig, options?: {
|
|
11
|
-
|
|
11
|
+
isAppX: boolean;
|
|
12
12
|
}): Plugin;
|
|
13
13
|
export declare function parseAssets(config: ResolvedConfig, code: string): string;
|
|
14
14
|
export declare function registerAssetToChunk(chunk: RenderedChunk, file: string): void;
|
|
@@ -84,7 +84,7 @@ function assetPlugin(config, options) {
|
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
id = id.replace(urlRE, '$1').replace(/[\?&]$/, '');
|
|
87
|
-
const url = await fileToUrl(id, config, options?.
|
|
87
|
+
const url = await fileToUrl(id, config, options?.isAppX
|
|
88
88
|
? {
|
|
89
89
|
emitFile(emittedFile) {
|
|
90
90
|
// 直接写入目标目录
|
|
@@ -92,7 +92,7 @@ function assetPlugin(config, options) {
|
|
|
92
92
|
},
|
|
93
93
|
}
|
|
94
94
|
: this);
|
|
95
|
-
if (options?.
|
|
95
|
+
if (options?.isAppX) {
|
|
96
96
|
this.emitFile({
|
|
97
97
|
type: 'asset',
|
|
98
98
|
fileName: (0, utils_3.normalizeNodeModules)(path_1.default.relative(process.env.UNI_INPUT_DIR, id) + '.uts'),
|
|
@@ -32,7 +32,7 @@ export declare const isDirectCSSRequest: (request: string) => boolean;
|
|
|
32
32
|
* Plugin applied before user plugins
|
|
33
33
|
*/
|
|
34
34
|
export declare function cssPlugin(config: ResolvedConfig, options?: {
|
|
35
|
-
|
|
35
|
+
isAppX: boolean;
|
|
36
36
|
getDescriptor?(filename: string): SFCDescriptor | undefined;
|
|
37
37
|
}): Plugin;
|
|
38
38
|
/**
|
|
@@ -97,7 +97,7 @@ function wrapResolve(resolve, code, source, getDescriptor) {
|
|
|
97
97
|
/**
|
|
98
98
|
* Plugin applied before user plugins
|
|
99
99
|
*/
|
|
100
|
-
function cssPlugin(config, options = {
|
|
100
|
+
function cssPlugin(config, options = { isAppX: false }) {
|
|
101
101
|
let server;
|
|
102
102
|
let moduleCache;
|
|
103
103
|
const resolveUrl = config.createResolver({
|
|
@@ -127,7 +127,7 @@ function cssPlugin(config, options = { isAndroidX: false }) {
|
|
|
127
127
|
}
|
|
128
128
|
const resolved = await wrapResolve(resolveUrl, source?.input.css || raw, source, options.getDescriptor)(url, importer);
|
|
129
129
|
if (resolved) {
|
|
130
|
-
return (0, asset_1.fileToUrl)(resolved, config, options?.
|
|
130
|
+
return (0, asset_1.fileToUrl)(resolved, config, options?.isAppX
|
|
131
131
|
? {
|
|
132
132
|
emitFile(emittedFile) {
|
|
133
133
|
// 直接写入目标目录
|
|
@@ -5,7 +5,7 @@ export interface UniViteFilterPluginOptions {
|
|
|
5
5
|
filter: (id: string) => boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function injectAssetPlugin(config: ResolvedConfig, options?: {
|
|
8
|
-
|
|
8
|
+
isAppX: boolean;
|
|
9
9
|
}): void;
|
|
10
10
|
export declare function injectCssPlugin(config: ResolvedConfig): void;
|
|
11
11
|
export declare function injectCssPostPlugin(config: ResolvedConfig, newCssPostPlugin: Plugin): void;
|
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-3090920231215001",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@ampproject/remapping": "^2.1.2",
|
|
25
25
|
"@babel/core": "^7.21.3",
|
|
26
|
-
"@babel/parser": "^7.
|
|
26
|
+
"@babel/parser": "^7.16.4",
|
|
27
27
|
"@babel/types": "^7.20.7",
|
|
28
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
29
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
28
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3090920231215001",
|
|
29
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3090920231215001",
|
|
30
30
|
"@intlify/core-base": "9.1.9",
|
|
31
31
|
"@intlify/shared": "9.1.9",
|
|
32
32
|
"@intlify/vue-devtools": "9.1.9",
|
|
33
33
|
"@rollup/pluginutils": "^4.2.0",
|
|
34
|
-
"@vue/compiler-core": "3.
|
|
35
|
-
"@vue/compiler-dom": "3.
|
|
36
|
-
"@vue/compiler-sfc": "3.
|
|
37
|
-
"@vue/server-renderer": "3.
|
|
38
|
-
"@vue/shared": "3.
|
|
34
|
+
"@vue/compiler-core": "3.2.47",
|
|
35
|
+
"@vue/compiler-dom": "3.2.47",
|
|
36
|
+
"@vue/compiler-sfc": "3.2.47",
|
|
37
|
+
"@vue/server-renderer": "3.2.47",
|
|
38
|
+
"@vue/shared": "3.2.47",
|
|
39
39
|
"autoprefixer": "^10.4.14",
|
|
40
40
|
"base64url": "^3.0.1",
|
|
41
41
|
"chokidar": "^3.5.3",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"fast-glob": "^3.2.11",
|
|
48
48
|
"fs-extra": "^10.0.0",
|
|
49
49
|
"hash-sum": "^2.0.0",
|
|
50
|
-
"jsonc-parser": "^3.
|
|
50
|
+
"jsonc-parser": "^3.0.0",
|
|
51
51
|
"magic-string": "^0.30.0",
|
|
52
52
|
"merge": "^2.1.1",
|
|
53
53
|
"mime": "^3.0.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@dcloudio/uni-uts-v1": "3.0.0-alpha-
|
|
67
|
+
"@dcloudio/uni-uts-v1": "3.0.0-alpha-3090920231215001",
|
|
68
68
|
"@types/babel__core": "^7.1.19",
|
|
69
69
|
"@types/debug": "^4.1.7",
|
|
70
70
|
"@types/estree": "^0.0.51",
|
|
@@ -78,6 +78,6 @@
|
|
|
78
78
|
"@types/stylus": "^0.48.36",
|
|
79
79
|
"postcss": "^8.4.21",
|
|
80
80
|
"unplugin-auto-import": "^0.16.7",
|
|
81
|
-
"vue": "3.
|
|
81
|
+
"vue": "3.2.47"
|
|
82
82
|
}
|
|
83
83
|
}
|