@rspack/cli 0.4.5 → 0.5.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.
- package/dist/rspack-cli.js +6 -20
- package/dist/utils/options.d.ts +1 -1
- package/package.json +3 -3
package/dist/rspack-cli.js
CHANGED
|
@@ -115,7 +115,7 @@ class RspackCLI {
|
|
|
115
115
|
let isBuild = command === "build";
|
|
116
116
|
let isServe = command === "serve";
|
|
117
117
|
const internalBuildConfig = async (item) => {
|
|
118
|
-
var _a;
|
|
118
|
+
var _a, _b;
|
|
119
119
|
if (options.entry) {
|
|
120
120
|
item.entry = {
|
|
121
121
|
main: options.entry.map(x => path_1.default.resolve(process.cwd(), x))[0] // Fix me when entry supports array
|
|
@@ -130,8 +130,8 @@ class RspackCLI {
|
|
|
130
130
|
}
|
|
131
131
|
// to set output.path
|
|
132
132
|
item.output = item.output || {};
|
|
133
|
-
if (options[
|
|
134
|
-
item.output.path = path_1.default.resolve(process.cwd(), options[
|
|
133
|
+
if (options["output-path"]) {
|
|
134
|
+
item.output.path = path_1.default.resolve(process.cwd(), options["output-path"]);
|
|
135
135
|
}
|
|
136
136
|
if (options.analyze) {
|
|
137
137
|
const { BundleAnalyzerPlugin } = await import("webpack-bundle-analyzer");
|
|
@@ -167,21 +167,9 @@ class RspackCLI {
|
|
|
167
167
|
item.builtins = item.builtins || {};
|
|
168
168
|
if (isServe) {
|
|
169
169
|
let installed = (item.plugins || (item.plugins = [])).find(item => item instanceof rspackCore.ProgressPlugin);
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
(o =
|
|
173
|
-
item.builtins.progress && typeof item.builtins.progress === "object"
|
|
174
|
-
? item.builtins.progress
|
|
175
|
-
: item.builtins.progress === true
|
|
176
|
-
? {}
|
|
177
|
-
: undefined)) {
|
|
178
|
-
(item.plugins || (item.plugins = [])).push(new rspackCore.ProgressPlugin(o));
|
|
170
|
+
if (!installed) {
|
|
171
|
+
((_b = item.plugins) !== null && _b !== void 0 ? _b : (item.plugins = [])).push(new rspackCore.ProgressPlugin());
|
|
179
172
|
}
|
|
180
|
-
delete item.builtins.progress;
|
|
181
|
-
}
|
|
182
|
-
// no emit assets when run dev server, it will use node_binding api get file content
|
|
183
|
-
if (typeof item.builtins.noEmitAssets === "undefined") {
|
|
184
|
-
item.builtins.noEmitAssets = false; // @FIXME memory fs currently cause problems for outputFileSystem, so we disable it temporarily
|
|
185
173
|
}
|
|
186
174
|
// Tells webpack to set process.env.NODE_ENV to a given string value.
|
|
187
175
|
// optimization.nodeEnv uses DefinePlugin unless set to false.
|
|
@@ -192,10 +180,8 @@ class RspackCLI {
|
|
|
192
180
|
if (item.mode !== "none") {
|
|
193
181
|
(item.plugins || (item.plugins = [])).push(new rspackCore.DefinePlugin({
|
|
194
182
|
// User defined `process.env.NODE_ENV` always has highest priority than default define
|
|
195
|
-
"process.env.NODE_ENV": JSON.stringify(item.mode)
|
|
196
|
-
...item.builtins.define
|
|
183
|
+
"process.env.NODE_ENV": JSON.stringify(item.mode)
|
|
197
184
|
}));
|
|
198
|
-
delete item.builtins.define;
|
|
199
185
|
}
|
|
200
186
|
if (typeof item.stats === "undefined") {
|
|
201
187
|
item.stats = { preset: "errors-warnings", timings: true };
|
package/dist/utils/options.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import yargs from "yargs";
|
|
2
|
-
export declare const commonOptions: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, "config" | "env" | "
|
|
2
|
+
export declare const commonOptions: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, "config" | "env" | "watch" | "entry" | "mode" | "devtool" | "output-path" | "node-env" | "configName"> & yargs.InferredOptionTypes<{
|
|
3
3
|
config: {
|
|
4
4
|
g: boolean;
|
|
5
5
|
type: "string";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "CLI for rspack",
|
|
6
6
|
"bin": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"internal-ip": "6.2.0",
|
|
32
32
|
"source-map-support": "^0.5.19",
|
|
33
33
|
"ts-node": "10.9.1",
|
|
34
|
-
"@rspack/core": "0.
|
|
34
|
+
"@rspack/core": "0.5.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@discoveryjs/json-ext": "^0.5.7",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"semver": "6.3.1",
|
|
43
43
|
"webpack-bundle-analyzer": "4.6.1",
|
|
44
44
|
"yargs": "17.6.2",
|
|
45
|
-
"@rspack/dev-server": "0.
|
|
45
|
+
"@rspack/dev-server": "0.5.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsc -b ./tsconfig.build.json",
|