@rspack/cli 1.0.0-alpha.2 → 1.0.0-alpha.4
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/cli.d.ts +2 -2
- package/dist/cli.js +3 -3
- package/dist/commands/build.d.ts +1 -1
- package/dist/commands/preview.d.ts +1 -1
- package/dist/commands/serve.d.ts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils/loadConfig.d.ts +2 -2
- package/dist/utils/options.d.ts +1 -1
- package/dist/utils/profile.d.ts +1 -1
- package/package.json +7 -4
package/dist/cli.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RspackPluginFunction, RspackPluginInstance } from "@rspack/core";
|
|
2
|
-
import { Compiler, MultiCompiler, MultiRspackOptions, MultiStats, RspackOptions, Stats } from "@rspack/core";
|
|
2
|
+
import { type Compiler, type MultiCompiler, type MultiRspackOptions, type MultiStats, type RspackOptions, type Stats } from "@rspack/core";
|
|
3
3
|
import yargs from "yargs";
|
|
4
|
-
import { RspackBuildCLIOptions, RspackCLIColors, RspackCLILogger, RspackCLIOptions } from "./types";
|
|
4
|
+
import type { RspackBuildCLIOptions, RspackCLIColors, RspackCLILogger, RspackCLIOptions } from "./types";
|
|
5
5
|
type Command = "serve" | "build";
|
|
6
6
|
export declare class RspackCLI {
|
|
7
7
|
colors: RspackCLIColors;
|
package/dist/cli.js
CHANGED
|
@@ -50,8 +50,8 @@ class RspackCLI {
|
|
|
50
50
|
process.env.RSPACK_CONFIG_VALIDATE = "loose";
|
|
51
51
|
process.env.WATCHPACK_WATCHER_LIMIT =
|
|
52
52
|
process.env.WATCHPACK_WATCHER_LIMIT || "20";
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const nodeEnv = process?.env?.NODE_ENV;
|
|
54
|
+
const rspackCommandDefaultEnv = rspackCommand === "build" ? "production" : "development";
|
|
55
55
|
if (typeof options.nodeEnv === "string") {
|
|
56
56
|
process.env.NODE_ENV = nodeEnv || options.nodeEnv;
|
|
57
57
|
}
|
|
@@ -170,7 +170,7 @@ class RspackCLI {
|
|
|
170
170
|
item.devtool = isBuild ? "source-map" : "cheap-module-source-map";
|
|
171
171
|
}
|
|
172
172
|
if (isServe) {
|
|
173
|
-
|
|
173
|
+
const installed = (item.plugins ||= []).find(item => item instanceof rspackCore.ProgressPlugin);
|
|
174
174
|
if (!installed) {
|
|
175
175
|
(item.plugins ??= []).push(new rspackCore.ProgressPlugin());
|
|
176
176
|
}
|
package/dist/commands/build.d.ts
CHANGED
package/dist/commands/serve.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DevServer } from "@rspack/core";
|
|
2
|
-
import { Colorette } from "colorette";
|
|
3
|
-
import { RspackCLI } from "./cli";
|
|
2
|
+
import type { Colorette } from "colorette";
|
|
3
|
+
import type { RspackCLI } from "./cli";
|
|
4
4
|
export type { Configuration } from "@rspack/core";
|
|
5
5
|
export interface IRspackCLI {
|
|
6
6
|
runRspack(): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MultiRspackOptions, RspackOptions } from "@rspack/core";
|
|
2
|
-
import { RspackCLIOptions } from "../types";
|
|
1
|
+
import type { MultiRspackOptions, RspackOptions } from "@rspack/core";
|
|
2
|
+
import type { RspackCLIOptions } from "../types";
|
|
3
3
|
export type LoadedRspackConfig = undefined | RspackOptions | MultiRspackOptions | ((env: Record<string, any>, argv?: Record<string, any>) => RspackOptions | MultiRspackOptions);
|
|
4
4
|
export declare function loadRspackConfig(options: RspackCLIOptions, cwd?: string): Promise<LoadedRspackConfig>;
|
package/dist/utils/options.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import yargs from "yargs";
|
|
1
|
+
import type yargs from "yargs";
|
|
2
2
|
export declare const commonOptions: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, "entry" | "devtool" | "mode" | "watch" | "env" | "output-path" | "config" | "node-env" | "configName"> & yargs.InferredOptionTypes<{
|
|
3
3
|
config: {
|
|
4
4
|
g: boolean;
|
package/dist/utils/profile.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RspackOptions } from "@rspack/core";
|
|
1
|
+
import { type RspackOptions } from "@rspack/core";
|
|
2
2
|
export declare function applyProfile(profileValue: string, item: RspackOptions): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/cli",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "CLI for rspack",
|
|
6
6
|
"publishConfig": {
|
|
@@ -24,17 +24,20 @@
|
|
|
24
24
|
"directory": "packages/rspack-cli"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@rspack/core": "
|
|
27
|
+
"@rspack/core": "^1.0.0-alpha"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/rechoir": "^0.6.1",
|
|
31
|
+
"@types/interpret": "^1.1.3",
|
|
31
32
|
"@types/semver": "^7.5.6",
|
|
32
33
|
"@types/webpack-bundle-analyzer": "^4.6.0",
|
|
34
|
+
"@types/yargs": "17.0.32",
|
|
35
|
+
"ts-node": "^10.9.2",
|
|
33
36
|
"concat-stream": "^2.0.0",
|
|
34
37
|
"cross-env": "^7.0.3",
|
|
35
38
|
"execa": "^5.0.0",
|
|
36
39
|
"internal-ip": "6.2.0",
|
|
37
|
-
"@rspack/core": "1.0.0-alpha.
|
|
40
|
+
"@rspack/core": "1.0.0-alpha.4"
|
|
38
41
|
},
|
|
39
42
|
"dependencies": {
|
|
40
43
|
"@discoveryjs/json-ext": "^0.5.7",
|
|
@@ -45,7 +48,7 @@
|
|
|
45
48
|
"semver": "6.3.1",
|
|
46
49
|
"webpack-bundle-analyzer": "4.6.1",
|
|
47
50
|
"yargs": "17.6.2",
|
|
48
|
-
"@rspack/dev-server": "1.0.0-alpha.
|
|
51
|
+
"@rspack/dev-server": "1.0.0-alpha.4"
|
|
49
52
|
},
|
|
50
53
|
"scripts": {
|
|
51
54
|
"build": "tsc -b ./tsconfig.build.json",
|