@rspack/cli 0.2.8 → 0.2.9-canary-b13dc30-20230725112333
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/commands/build.js +2 -0
- package/dist/commands/preview.js +2 -0
- package/dist/commands/serve.js +2 -0
- package/dist/rspack-cli.d.ts +1 -1
- package/dist/rspack-cli.js +4 -2
- package/dist/types.d.ts +1 -1
- package/dist/utils/options.d.ts +1 -1
- package/package.json +3 -3
package/dist/commands/build.js
CHANGED
package/dist/commands/preview.js
CHANGED
|
@@ -30,6 +30,8 @@ class PreviewCommand {
|
|
|
30
30
|
config = config.find(item => item.devServer) || config[0];
|
|
31
31
|
const devServerOptions = config.devServer;
|
|
32
32
|
let compiler = (0, core_1.rspack)({ entry: {} });
|
|
33
|
+
if (!compiler)
|
|
34
|
+
return;
|
|
33
35
|
try {
|
|
34
36
|
const server = new dev_server_1.RspackDevServer(devServerOptions, compiler);
|
|
35
37
|
await server.start();
|
package/dist/commands/serve.js
CHANGED
package/dist/rspack-cli.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class RspackCLI {
|
|
|
7
7
|
colors: RspackCLIColors;
|
|
8
8
|
program: yargs.Argv<{}>;
|
|
9
9
|
constructor();
|
|
10
|
-
createCompiler(options: RspackBuildCLIOptions, rspackCommand: Command, callback?: (e: Error, res?: Stats | MultiStats) => void): Promise<Compiler |
|
|
10
|
+
createCompiler(options: RspackBuildCLIOptions, rspackCommand: Command, callback?: (e: Error, res?: Stats | MultiStats) => void): Promise<MultiCompiler | Compiler | null>;
|
|
11
11
|
createColors(useColor?: boolean): RspackCLIColors;
|
|
12
12
|
getLogger(): RspackCLILogger;
|
|
13
13
|
run(argv: string[]): Promise<void>;
|
package/dist/rspack-cli.js
CHANGED
|
@@ -38,8 +38,7 @@ class RspackCLI {
|
|
|
38
38
|
const isWatch = Array.isArray(config)
|
|
39
39
|
? config.some(i => i.watch)
|
|
40
40
|
: config.watch;
|
|
41
|
-
|
|
42
|
-
return compiler;
|
|
41
|
+
return (0, core_1.rspack)(config, isWatch ? callback : undefined);
|
|
43
42
|
}
|
|
44
43
|
createColors(useColor) {
|
|
45
44
|
const { createColors, isColorSupported } = require("colorette");
|
|
@@ -66,6 +65,7 @@ class RspackCLI {
|
|
|
66
65
|
};
|
|
67
66
|
}
|
|
68
67
|
async run(argv) {
|
|
68
|
+
// @ts-expect-error
|
|
69
69
|
if (semver_1.default.lt(semver_1.default.clean(process.version), "14.0.0")) {
|
|
70
70
|
this.getLogger().warn(`Minimum recommended Node.js version is 14.0.0, current version is ${process.version}`);
|
|
71
71
|
}
|
|
@@ -206,12 +206,14 @@ class RspackCLI {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
if (typeof loadedConfig === "function") {
|
|
209
|
+
// @ts-expect-error
|
|
209
210
|
loadedConfig = loadedConfig((_a = options.argv) === null || _a === void 0 ? void 0 : _a.env, options.argv);
|
|
210
211
|
// if return promise we should await its result
|
|
211
212
|
if (typeof loadedConfig.then === "function") {
|
|
212
213
|
loadedConfig = await loadedConfig;
|
|
213
214
|
}
|
|
214
215
|
}
|
|
216
|
+
// @ts-expect-error
|
|
215
217
|
return loadedConfig;
|
|
216
218
|
}
|
|
217
219
|
isMultipleCompiler(compiler) {
|
package/dist/types.d.ts
CHANGED
package/dist/utils/options.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export declare const commonOptions: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.
|
|
|
41
41
|
};
|
|
42
42
|
}>>;
|
|
43
43
|
export declare const previewOptions: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{
|
|
44
|
-
dir: string;
|
|
44
|
+
dir: string | undefined;
|
|
45
45
|
}, "port" | "host" | "open" | "server" | "publicPath" | "config" | "configName"> & yargs.InferredOptionTypes<{
|
|
46
46
|
publicPath: {
|
|
47
47
|
type: "string";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9-canary-b13dc30-20230725112333",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "CLI for rspack",
|
|
6
6
|
"bin": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"semver": "6.3.0",
|
|
37
37
|
"webpack-bundle-analyzer": "4.6.1",
|
|
38
38
|
"yargs": "17.6.2",
|
|
39
|
-
"@rspack/core": "0.2.
|
|
40
|
-
"@rspack/dev-server": "0.2.
|
|
39
|
+
"@rspack/core": "0.2.9-canary-b13dc30-20230725112333",
|
|
40
|
+
"@rspack/dev-server": "0.2.9-canary-b13dc30-20230725112333"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "rimraf dist/ && tsc -b ./tsconfig.build.json --force",
|