weapp-vite 5.0.0-beta.0 → 5.0.0
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.
|
@@ -24519,6 +24519,9 @@ var NpmService2 = class {
|
|
|
24519
24519
|
js: ".js"
|
|
24520
24520
|
};
|
|
24521
24521
|
}, "outExtensions"),
|
|
24522
|
+
outputOptions: {
|
|
24523
|
+
exports: "auto"
|
|
24524
|
+
},
|
|
24522
24525
|
// https://github.com/egoist/tsup/blob/769aa49cae16cc1713992970db966d6514878e06/src/rollup/ts-resolve.ts#L3
|
|
24523
24526
|
// esbuildOptions(options) {
|
|
24524
24527
|
// options.plugins?.unshift(
|
|
@@ -24520,6 +24520,9 @@ var NpmService2 = (_class18 = class {
|
|
|
24520
24520
|
js: ".js"
|
|
24521
24521
|
};
|
|
24522
24522
|
}, "outExtensions"),
|
|
24523
|
+
outputOptions: {
|
|
24524
|
+
exports: "auto"
|
|
24525
|
+
},
|
|
24523
24526
|
// https://github.com/egoist/tsup/blob/769aa49cae16cc1713992970db966d6514878e06/src/rollup/ts-resolve.ts#L3
|
|
24524
24527
|
// esbuildOptions(options) {
|
|
24525
24528
|
// options.plugins?.unshift(
|
package/dist/cli.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkNQB54BOLcjs = require('./chunk-NQB54BOL.cjs');
|
|
7
7
|
require('./chunk-OQE2HRTT.cjs');
|
|
8
8
|
require('./chunk-CWXQPTX3.cjs');
|
|
9
9
|
|
|
@@ -823,14 +823,14 @@ async function generate(options) {
|
|
|
823
823
|
for (const { code, fileName: fileName2 } of files) {
|
|
824
824
|
if (code !== void 0) {
|
|
825
825
|
await _fsextra2.default.outputFile(_pathe2.default.resolve(basepath, fileName2), code, "utf8");
|
|
826
|
-
|
|
826
|
+
_chunkNQB54BOLcjs.logger_default.success(`${composePath(outDir, fileName2)} \u521B\u5EFA\u6210\u529F\uFF01`);
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
830
|
_chunk5OGRUAWTcjs.__name.call(void 0, generate, "generate");
|
|
831
831
|
|
|
832
832
|
// src/cli.ts
|
|
833
|
-
var import_reflect_metadata = _chunk5OGRUAWTcjs.__toESM.call(void 0,
|
|
833
|
+
var import_reflect_metadata = _chunk5OGRUAWTcjs.__toESM.call(void 0, _chunkNQB54BOLcjs.require_Reflect.call(void 0, ), 1);
|
|
834
834
|
var cli = cac("weapp-vite");
|
|
835
835
|
function loadConfig() {
|
|
836
836
|
return _vite.loadConfigFromFile.call(void 0, {
|
|
@@ -852,9 +852,9 @@ function logBuildAppFinish(configService) {
|
|
|
852
852
|
]
|
|
853
853
|
}));
|
|
854
854
|
const devCommand = `${command} ${args.join(" ")}`;
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
855
|
+
_chunkNQB54BOLcjs.logger_default.success("\u5E94\u7528\u6784\u5EFA\u5B8C\u6210\uFF01\u9884\u89C8\u65B9\u5F0F ( `2` \u79CD\u9009\u5176\u4E00\u5373\u53EF)\uFF1A");
|
|
856
|
+
_chunkNQB54BOLcjs.logger_default.info(`\u6267\u884C \`${devCommand}\` \u53EF\u4EE5\u76F4\u63A5\u5728 \`\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\` \u91CC\u6253\u5F00\u5F53\u524D\u5E94\u7528`);
|
|
857
|
+
_chunkNQB54BOLcjs.logger_default.info("\u6216\u624B\u52A8\u6253\u5F00\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\uFF0C\u5BFC\u5165\u6839\u76EE\u5F55(`project.config.json` \u6587\u4EF6\u6240\u5728\u7684\u76EE\u5F55)\uFF0C\u5373\u53EF\u9884\u89C8\u6548\u679C");
|
|
858
858
|
logBuildAppFinishOnlyShowOnce = true;
|
|
859
859
|
}
|
|
860
860
|
}
|
|
@@ -881,7 +881,7 @@ async function openIde() {
|
|
|
881
881
|
"-p"
|
|
882
882
|
]);
|
|
883
883
|
} catch (error) {
|
|
884
|
-
|
|
884
|
+
_chunkNQB54BOLcjs.logger_default.error(error);
|
|
885
885
|
}
|
|
886
886
|
}
|
|
887
887
|
_chunk5OGRUAWTcjs.__name.call(void 0, openIde, "openIde");
|
|
@@ -892,7 +892,7 @@ cli.option("-c, --config <file>", `[string] use specified config file`).option("
|
|
|
892
892
|
}).option("-l, --logLevel <level>", `[string] info | warn | error | silent`).option("--clearScreen", `[boolean] allow/disable clear screen when logging`).option("-d, --debug [feat]", `[string | boolean] show debug logs`).option("-f, --filter <filter>", `[string] filter debug logs`).option("-m, --mode <mode>", `[string] set env mode`);
|
|
893
893
|
cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--skipNpm", `[boolean] if skip npm build`).option("-o, --open", `[boolean] open ide`).action(async (root, options) => {
|
|
894
894
|
filterDuplicateOptions(options);
|
|
895
|
-
const { buildService, configService } = await
|
|
895
|
+
const { buildService, configService } = await _chunkNQB54BOLcjs.createCompilerContext.call(void 0, {
|
|
896
896
|
cwd: root,
|
|
897
897
|
mode: options.mode,
|
|
898
898
|
isDev: true
|
|
@@ -905,7 +905,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
|
905
905
|
});
|
|
906
906
|
cli.command("build [root]", "build for production").option("--target <target>", `[string] transpile target (default: 'modules')`).option("--outDir <dir>", `[string] output directory (default: dist)`).option("--sourcemap [output]", `[boolean | "inline" | "hidden"] output source maps for build (default: false)`).option("--minify [minifier]", `[boolean | "terser" | "esbuild"] enable/disable minification, or specify minifier to use (default: esbuild)`).option("--emptyOutDir", `[boolean] force empty outDir when it's outside of root`).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--skipNpm", `[boolean] if skip npm build`).option("-o, --open", `[boolean] open ide`).action(async (root, options) => {
|
|
907
907
|
filterDuplicateOptions(options);
|
|
908
|
-
const { buildService, configService } = await
|
|
908
|
+
const { buildService, configService } = await _chunkNQB54BOLcjs.createCompilerContext.call(void 0, {
|
|
909
909
|
cwd: root,
|
|
910
910
|
mode: options.mode
|
|
911
911
|
});
|
|
@@ -921,7 +921,7 @@ cli.command("init").action(async () => {
|
|
|
921
921
|
command: "weapp-vite"
|
|
922
922
|
});
|
|
923
923
|
} catch (error) {
|
|
924
|
-
|
|
924
|
+
_chunkNQB54BOLcjs.logger_default.error(error);
|
|
925
925
|
}
|
|
926
926
|
});
|
|
927
927
|
cli.command("open").action(async () => {
|
|
@@ -934,7 +934,7 @@ cli.command("npm").alias("build:npm").alias("build-npm").action(async () => {
|
|
|
934
934
|
"-p"
|
|
935
935
|
]);
|
|
936
936
|
} catch (error) {
|
|
937
|
-
|
|
937
|
+
_chunkNQB54BOLcjs.logger_default.error(error);
|
|
938
938
|
}
|
|
939
939
|
});
|
|
940
940
|
cli.command("gc [filepath]", "generate component").alias("g").alias("generate").option("-a, --app", "type app").option("-p, --page", "type app").option("-n, --name <name>", "filename").action(async (filepath, options) => {
|
|
@@ -949,7 +949,7 @@ cli.command("gc [filepath]", "generate component").alias("g").alias("generate").
|
|
|
949
949
|
fileName = "app";
|
|
950
950
|
}
|
|
951
951
|
if (filepath === void 0) {
|
|
952
|
-
|
|
952
|
+
_chunkNQB54BOLcjs.logger_default.error("weapp-vite generate <outDir> \u547D\u4EE4\u5FC5\u987B\u4F20\u5165\u8DEF\u5F84\u53C2\u6570 outDir");
|
|
953
953
|
return;
|
|
954
954
|
}
|
|
955
955
|
if (options.page) {
|
|
@@ -968,5 +968,5 @@ cli.command("create [outDir]", "create project").option("-t, --template <type>",
|
|
|
968
968
|
await _init.createProject.call(void 0, outDir, options.template);
|
|
969
969
|
});
|
|
970
970
|
cli.help();
|
|
971
|
-
cli.version(
|
|
971
|
+
cli.version(_chunkNQB54BOLcjs.VERSION);
|
|
972
972
|
cli.parse();
|
package/dist/cli.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkNQB54BOLcjs = require('./chunk-NQB54BOL.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkOQE2HRTTcjs = require('./chunk-OQE2HRTT.cjs');
|
|
@@ -19,7 +19,7 @@ var _chunk5OGRUAWTcjs = require('./chunk-5OGRUAWT.cjs');
|
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
_chunk5OGRUAWTcjs.init_cjs_shims.call(void 0, );
|
|
22
|
-
var import_reflect_metadata = _chunk5OGRUAWTcjs.__toESM.call(void 0,
|
|
22
|
+
var import_reflect_metadata = _chunk5OGRUAWTcjs.__toESM.call(void 0, _chunkNQB54BOLcjs.require_Reflect.call(void 0, ), 1);
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -28,4 +28,4 @@ var import_reflect_metadata = _chunk5OGRUAWTcjs.__toESM.call(void 0, _chunkOUWD5
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
exports.createCompilerContext =
|
|
31
|
+
exports.createCompilerContext = _chunkNQB54BOLcjs.createCompilerContext; exports.defineAppJson = _chunkCWXQPTX3cjs.defineAppJson; exports.defineComponentJson = _chunkCWXQPTX3cjs.defineComponentJson; exports.defineConfig = _chunkOQE2HRTTcjs.defineConfig; exports.definePageJson = _chunkCWXQPTX3cjs.definePageJson; exports.defineSitemapJson = _chunkCWXQPTX3cjs.defineSitemapJson; exports.defineThemeJson = _chunkCWXQPTX3cjs.defineThemeJson;
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.0
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -96,14 +96,14 @@
|
|
|
96
96
|
"tsdown": "^0.12.7",
|
|
97
97
|
"vite": "npm:rolldown-vite@latest",
|
|
98
98
|
"vite-tsconfig-paths": "^5.1.4",
|
|
99
|
-
"@weapp-core/init": "^2.0.0
|
|
100
|
-
"@weapp-core/logger": "^
|
|
101
|
-
"@weapp-core/schematics": "^
|
|
102
|
-
"@weapp-core/shared": "^
|
|
99
|
+
"@weapp-core/init": "^2.0.0",
|
|
100
|
+
"@weapp-core/logger": "^2.0.0",
|
|
101
|
+
"@weapp-core/schematics": "^2.0.0",
|
|
102
|
+
"@weapp-core/shared": "^2.0.0",
|
|
103
103
|
"@weapp-vite/volar": "^0.0.1",
|
|
104
104
|
"rolldown-require": "^1.0.0",
|
|
105
105
|
"vite-plugin-performance": "^0.0.1",
|
|
106
|
-
"weapp-ide-cli": "^
|
|
106
|
+
"weapp-ide-cli": "^3.0.0"
|
|
107
107
|
},
|
|
108
108
|
"publishConfig": {
|
|
109
109
|
"access": "public",
|