@varlet/cli 2.4.3-alpha.1671118557898 → 2.4.3-alpha.1672072688719
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.
|
@@ -5,7 +5,7 @@ import { EXAMPLE_DIR_NAME, TESTS_DIR_NAME, DOCS_DIR_NAME, SRC_DIR, ES_DIR, STYLE
|
|
|
5
5
|
import { getPublicDirs, isDir, isDTS, isLess, isScript, isSFC } from '../shared/fsUtils.js';
|
|
6
6
|
import { compileSFC } from './compileSFC.js';
|
|
7
7
|
import { compileESEntry, compileCommonJSEntry, compileScriptFile } from './compileScript.js';
|
|
8
|
-
import { compileLess } from './compileStyle.js';
|
|
8
|
+
import { clearLessFiles, compileLess } from './compileStyle.js';
|
|
9
9
|
import { getESMBundleConfig, getUMDConfig } from '../config/vite.config.js';
|
|
10
10
|
import { getVarletConfig } from '../config/varlet.config.js';
|
|
11
11
|
import { generateReference } from './compileTypes.js';
|
|
@@ -70,5 +70,6 @@ export async function compileModule(modules = false) {
|
|
|
70
70
|
else {
|
|
71
71
|
await compileESEntry(dest, publicDirs);
|
|
72
72
|
}
|
|
73
|
+
clearLessFiles(dest);
|
|
73
74
|
generateReference(dest);
|
|
74
75
|
}
|
|
@@ -9,3 +9,4 @@ export declare const clearEmptyLine: (s: string) => string;
|
|
|
9
9
|
export declare function normalizeStyleDependency(styleImport: string, reg: RegExp): string;
|
|
10
10
|
export declare function extractStyleDependencies(file: string, code: string, styleReg: RegExp): string;
|
|
11
11
|
export declare function compileLess(file: string): Promise<void>;
|
|
12
|
+
export declare function clearLessFiles(dir: string): void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import fse from 'fs-extra';
|
|
2
2
|
import less from 'less';
|
|
3
|
+
import glob from 'glob';
|
|
3
4
|
import { replaceExt, smartAppendFileSync } from '../shared/fsUtils.js';
|
|
4
5
|
import { parse, resolve } from 'path';
|
|
5
6
|
const { render } = less;
|
|
6
|
-
const { readFileSync,
|
|
7
|
+
const { readFileSync, writeFileSync, unlinkSync } = fse;
|
|
7
8
|
export const EMPTY_SPACE_RE = /[\s]+/g;
|
|
8
9
|
export const EMPTY_LINE_RE = /[\n\r]*/g;
|
|
9
10
|
export const IMPORT_CSS_RE = /(?<!['"`])import\s+['"](\.{1,2}\/.+\.css)['"]\s*;?(?!\s*['"`])/g;
|
|
@@ -34,6 +35,9 @@ export function extractStyleDependencies(file, code, styleReg) {
|
|
|
34
35
|
export async function compileLess(file) {
|
|
35
36
|
const source = readFileSync(file, 'utf-8');
|
|
36
37
|
const { css } = await render(source, { filename: file });
|
|
37
|
-
removeSync(file);
|
|
38
38
|
writeFileSync(replaceExt(file, '.css'), clearEmptyLine(css), 'utf-8');
|
|
39
39
|
}
|
|
40
|
+
export function clearLessFiles(dir) {
|
|
41
|
+
const files = glob.sync(`${dir}/**/*.less`);
|
|
42
|
+
files.forEach(unlinkSync);
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/cli",
|
|
3
|
-
"version": "2.4.3-alpha.
|
|
3
|
+
"version": "2.4.3-alpha.1672072688719",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "cli of varlet",
|
|
6
6
|
"bin": {
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"vite-plugin-html": "^2.1.0",
|
|
69
69
|
"vue": "3.2.25",
|
|
70
70
|
"vue-jest": "^5.0.0-alpha.8",
|
|
71
|
-
"@varlet/
|
|
72
|
-
"@varlet/
|
|
71
|
+
"@varlet/markdown-vite-plugin": "2.4.3-alpha.1672072688719",
|
|
72
|
+
"@varlet/shared": "2.4.3-alpha.1672072688719"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/babel__core": "^7.1.12",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"@types/lodash-es": "^4.17.5",
|
|
81
81
|
"@types/node": "^18.7.20",
|
|
82
82
|
"@types/semver": "^7.3.9",
|
|
83
|
-
"@varlet/
|
|
84
|
-
"@varlet/
|
|
83
|
+
"@varlet/icons": "2.4.3-alpha.1672072688719",
|
|
84
|
+
"@varlet/touch-emulator": "2.4.3-alpha.1672072688719"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"@vue/runtime-core": "3.2.16",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"lodash-es": "^4.17.21",
|
|
92
92
|
"vue": "3.2.25",
|
|
93
93
|
"vue-router": "4.0.12",
|
|
94
|
-
"@varlet/icons": "2.4.3-alpha.
|
|
95
|
-
"@varlet/touch-emulator": "2.4.3-alpha.
|
|
94
|
+
"@varlet/icons": "2.4.3-alpha.1672072688719",
|
|
95
|
+
"@varlet/touch-emulator": "2.4.3-alpha.1672072688719"
|
|
96
96
|
},
|
|
97
97
|
"scripts": {
|
|
98
98
|
"dev": "tsc --watch",
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.var-site-icon {
|
|
10
|
+
position: relative;
|
|
10
11
|
display: inline-flex;
|
|
11
12
|
justify-content: center;
|
|
12
13
|
align-items: center;
|
|
@@ -14,6 +15,16 @@
|
|
|
14
15
|
color: inherit;
|
|
15
16
|
vertical-align: bottom;
|
|
16
17
|
|
|
18
|
+
&::before {
|
|
19
|
+
position: relative;
|
|
20
|
+
display: inline-block;
|
|
21
|
+
font-size: inherit;
|
|
22
|
+
text-rendering: auto;
|
|
23
|
+
-webkit-font-smoothing: antialiased;
|
|
24
|
+
font-weight: normal;
|
|
25
|
+
font-style: normal;
|
|
26
|
+
}
|
|
27
|
+
|
|
17
28
|
&--shrinking {
|
|
18
29
|
transform: scale(0);
|
|
19
30
|
}
|