@varlet/cli 2.7.0-alpha.1673623558342 → 2.7.0-alpha.1673624403817
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.
|
@@ -9,6 +9,8 @@ import { getVarletConfig } from '../config/varlet.config.js';
|
|
|
9
9
|
const { writeFileSync, readdirSync, readFileSync, removeSync, writeFile, pathExistsSync } = fse;
|
|
10
10
|
// https://regexr.com/765a4
|
|
11
11
|
export const IMPORT_FROM_DEPENDENCE_RE = /import\s+?[\w\s{},$*]+\s+from\s+?(".*?"|'.*?')/g;
|
|
12
|
+
// https://regexr.com/767e6
|
|
13
|
+
export const EXPORT_FROM_DEPENDENCE_RE = /export\s+?[\w\s{},$*]+\s+from\s+?(".*?"|'.*?')/g;
|
|
12
14
|
// https://regexr.com/764ve
|
|
13
15
|
export const IMPORT_DEPENDENCE_RE = /import\s+(".*?"|'.*?')/g;
|
|
14
16
|
// https://regexr.com/764vn
|
|
@@ -77,6 +79,7 @@ export const resolveDependence = (file, script) => {
|
|
|
77
79
|
};
|
|
78
80
|
return script
|
|
79
81
|
.replace(IMPORT_FROM_DEPENDENCE_RE, replacer)
|
|
82
|
+
.replace(EXPORT_FROM_DEPENDENCE_RE, replacer)
|
|
80
83
|
.replace(IMPORT_DEPENDENCE_RE, replacer)
|
|
81
84
|
.replace(REQUIRE_DEPENDENCE_RE, replacer);
|
|
82
85
|
};
|
|
@@ -156,7 +159,7 @@ export default {
|
|
|
156
159
|
const styleTemplate = `\
|
|
157
160
|
${cssImports.join('\n')}
|
|
158
161
|
`;
|
|
159
|
-
const
|
|
162
|
+
const bundleTemplate = `\
|
|
160
163
|
${imports.join('\n')}\n
|
|
161
164
|
${cssImports.join('\n')}\n
|
|
162
165
|
${version}
|
|
@@ -175,7 +178,7 @@ export default {
|
|
|
175
178
|
`;
|
|
176
179
|
await Promise.all([
|
|
177
180
|
writeFile(resolve(dir, 'index.mjs'), indexTemplate, 'utf-8'),
|
|
178
|
-
writeFile(resolve(dir, 'index.
|
|
181
|
+
writeFile(resolve(dir, 'index.bundle.mjs'), bundleTemplate, 'utf-8'),
|
|
179
182
|
writeFile(resolve(dir, 'style.mjs'), styleTemplate, 'utf-8'),
|
|
180
183
|
]);
|
|
181
184
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import fse from 'fs-extra';
|
|
2
1
|
import vue from '@vitejs/plugin-vue';
|
|
3
2
|
import jsx from '@vitejs/plugin-vue-jsx';
|
|
4
3
|
import { markdown, html, inlineCss } from '@varlet/vite-plugins';
|
|
5
4
|
import { ES_DIR, SITE_CONFIG, SITE_DIR, SITE_MOBILE_ROUTES, SITE_OUTPUT_PATH, SITE_PC_ROUTES, SITE_PUBLIC_PATH, VITE_RESOLVE_EXTENSIONS, } from '../shared/constant.js';
|
|
6
5
|
import { get } from 'lodash-es';
|
|
7
6
|
import { resolve } from 'path';
|
|
8
|
-
const { copyFileSync, removeSync } = fse;
|
|
9
7
|
export function getDevConfig(varletConfig) {
|
|
10
8
|
const defaultLanguage = get(varletConfig, 'defaultLanguage');
|
|
11
9
|
const host = get(varletConfig, 'host');
|
|
@@ -76,7 +74,7 @@ export function getBundleConfig(varletConfig, buildOptions) {
|
|
|
76
74
|
name,
|
|
77
75
|
formats: [format],
|
|
78
76
|
fileName: () => fileName,
|
|
79
|
-
entry: resolve(ES_DIR, 'index.
|
|
77
|
+
entry: resolve(ES_DIR, 'index.bundle.mjs'),
|
|
80
78
|
},
|
|
81
79
|
rollupOptions: {
|
|
82
80
|
external: ['vue'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/cli",
|
|
3
|
-
"version": "2.7.0-alpha.
|
|
3
|
+
"version": "2.7.0-alpha.1673624403817",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "cli of varlet",
|
|
6
6
|
"bin": {
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"vite": "4.0.4",
|
|
67
67
|
"vue": "3.2.25",
|
|
68
68
|
"vue-jest": "^5.0.0-alpha.8",
|
|
69
|
-
"@varlet/vite-plugins": "2.7.0-alpha.
|
|
70
|
-
"@varlet/shared": "2.7.0-alpha.
|
|
69
|
+
"@varlet/vite-plugins": "2.7.0-alpha.1673624403817",
|
|
70
|
+
"@varlet/shared": "2.7.0-alpha.1673624403817"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@types/babel__core": "^7.1.12",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"@types/node": "^18.7.20",
|
|
80
80
|
"@types/semver": "^7.3.9",
|
|
81
81
|
"@types/inquirer": "^9.0.2",
|
|
82
|
-
"@varlet/
|
|
83
|
-
"@varlet/
|
|
82
|
+
"@varlet/touch-emulator": "2.7.0-alpha.1673624403817",
|
|
83
|
+
"@varlet/icons": "2.7.0-alpha.1673624403817"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"@vue/runtime-core": "3.2.16",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"lodash-es": "^4.17.21",
|
|
91
91
|
"vue": "3.2.25",
|
|
92
92
|
"vue-router": "4.0.12",
|
|
93
|
-
"@varlet/icons": "2.7.0-alpha.
|
|
94
|
-
"@varlet/touch-emulator": "2.7.0-alpha.
|
|
93
|
+
"@varlet/icons": "2.7.0-alpha.1673624403817",
|
|
94
|
+
"@varlet/touch-emulator": "2.7.0-alpha.1673624403817"
|
|
95
95
|
},
|
|
96
96
|
"scripts": {
|
|
97
97
|
"dev": "tsc --watch",
|