@rspack/cli 0.6.5 → 0.7.0-beta.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/commands/preview.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/rspack-cli.d.ts +2 -2
- package/dist/rspack-cli.js +8 -20
- package/dist/types.d.ts +1 -1
- package/dist/utils/loadConfig.d.ts +1 -1
- package/dist/utils/loadConfig.js +4 -4
- package/dist/utils/profile.js +2 -2
- package/package.json +3 -3
package/dist/commands/preview.js
CHANGED
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PreviewCommand = void 0;
|
|
7
|
-
const options_1 = require("../utils/options");
|
|
8
7
|
const core_1 = require("@rspack/core");
|
|
9
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const options_1 = require("../utils/options");
|
|
10
10
|
const defaultRoot = "dist";
|
|
11
11
|
class PreviewCommand {
|
|
12
12
|
async apply(cli) {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,9 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
17
|
+
exports.RspackCLI = exports.definePlugin = exports.defineConfig = void 0;
|
|
19
18
|
var rspack_cli_1 = require("./rspack-cli");
|
|
20
|
-
Object.defineProperty(exports, "RspackCLI", { enumerable: true, get: function () { return rspack_cli_1.RspackCLI; } });
|
|
21
19
|
Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return rspack_cli_1.defineConfig; } });
|
|
22
20
|
Object.defineProperty(exports, "definePlugin", { enumerable: true, get: function () { return rspack_cli_1.definePlugin; } });
|
|
21
|
+
Object.defineProperty(exports, "RspackCLI", { enumerable: true, get: function () { return rspack_cli_1.RspackCLI; } });
|
|
22
|
+
__exportStar(require("./types"), exports);
|
package/dist/rspack-cli.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { RspackPluginFunction, RspackPluginInstance } from "@rspack/core";
|
|
2
|
+
import { Compiler, MultiCompiler, MultiRspackOptions, MultiStats, RspackOptions, Stats } from "@rspack/core";
|
|
1
3
|
import yargs from "yargs";
|
|
2
4
|
import { RspackBuildCLIOptions, RspackCLIColors, RspackCLILogger, RspackCLIOptions } from "./types";
|
|
3
|
-
import { RspackOptions, MultiCompiler, MultiRspackOptions, Stats, MultiStats, Compiler } from "@rspack/core";
|
|
4
|
-
import type { RspackPluginInstance, RspackPluginFunction } from "@rspack/core";
|
|
5
5
|
type Command = "serve" | "build";
|
|
6
6
|
export declare class RspackCLI {
|
|
7
7
|
colors: RspackCLIColors;
|
package/dist/rspack-cli.js
CHANGED
|
@@ -27,19 +27,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.definePlugin = exports.defineConfig = exports.RspackCLI = void 0;
|
|
30
|
+
const core_1 = require("@rspack/core");
|
|
31
|
+
const rspackCore = __importStar(require("@rspack/core"));
|
|
32
|
+
const path_1 = __importDefault(require("path"));
|
|
30
33
|
const semver_1 = __importDefault(require("semver"));
|
|
31
|
-
const helpers_1 = require("yargs/helpers");
|
|
32
|
-
const yargs_1 = __importDefault(require("yargs"));
|
|
33
34
|
const util_1 = __importDefault(require("util"));
|
|
35
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
36
|
+
const helpers_1 = require("yargs/helpers");
|
|
34
37
|
const build_1 = require("./commands/build");
|
|
35
|
-
const serve_1 = require("./commands/serve");
|
|
36
38
|
const preview_1 = require("./commands/preview");
|
|
37
|
-
const
|
|
38
|
-
const options_1 = require("./utils/options");
|
|
39
|
-
const loadConfig_1 = require("./utils/loadConfig");
|
|
39
|
+
const serve_1 = require("./commands/serve");
|
|
40
40
|
const findConfig_1 = __importDefault(require("./utils/findConfig"));
|
|
41
|
-
const
|
|
42
|
-
const
|
|
41
|
+
const loadConfig_1 = require("./utils/loadConfig");
|
|
42
|
+
const options_1 = require("./utils/options");
|
|
43
43
|
const defaultEntry = "src/index";
|
|
44
44
|
class RspackCLI {
|
|
45
45
|
constructor() {
|
|
@@ -173,18 +173,6 @@ class RspackCLI {
|
|
|
173
173
|
((_b = item.plugins) !== null && _b !== void 0 ? _b : (item.plugins = [])).push(new rspackCore.ProgressPlugin());
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
// Tells webpack to set process.env.NODE_ENV to a given string value.
|
|
177
|
-
// optimization.nodeEnv uses DefinePlugin unless set to false.
|
|
178
|
-
// optimization.nodeEnv defaults to mode if set, else falls back to 'production'.
|
|
179
|
-
// See doc: https://webpack.js.org/configuration/optimization/#optimizationnodeenv
|
|
180
|
-
// See source: https://github.com/webpack/webpack/blob/8241da7f1e75c5581ba535d127fa66aeb9eb2ac8/lib/WebpackOptionsApply.js#L563
|
|
181
|
-
// When mode is set to 'none', optimization.nodeEnv defaults to false.
|
|
182
|
-
if (item.mode !== "none") {
|
|
183
|
-
(item.plugins || (item.plugins = [])).push(new rspackCore.DefinePlugin({
|
|
184
|
-
// User defined `process.env.NODE_ENV` always has highest priority than default define
|
|
185
|
-
"process.env.NODE_ENV": JSON.stringify(item.mode)
|
|
186
|
-
}));
|
|
187
|
-
}
|
|
188
176
|
if (typeof item.stats === "undefined") {
|
|
189
177
|
item.stats = { preset: "errors-warnings", timings: true };
|
|
190
178
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { DevServer } from "@rspack/core";
|
|
1
2
|
import { Colorette } from "colorette";
|
|
2
3
|
import { RspackCLI } from "./rspack-cli";
|
|
3
|
-
import type { DevServer } from "@rspack/core";
|
|
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";
|
|
1
2
|
import { RspackCLIOptions } from "../types";
|
|
2
|
-
import { RspackOptions, MultiRspackOptions } from "@rspack/core";
|
|
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/loadConfig.js
CHANGED
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.loadRspackConfig = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
7
|
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const findConfig_1 = __importDefault(require("./findConfig"));
|
|
10
|
-
const rechoir_1 = __importDefault(require("rechoir"));
|
|
11
8
|
const interpret_1 = __importDefault(require("interpret"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const rechoir_1 = __importDefault(require("rechoir"));
|
|
11
|
+
const crossImport_1 = __importDefault(require("./crossImport"));
|
|
12
|
+
const findConfig_1 = __importDefault(require("./findConfig"));
|
|
12
13
|
const isEsmFile_1 = __importDefault(require("./isEsmFile"));
|
|
13
14
|
const isTsFile_1 = __importDefault(require("./isTsFile"));
|
|
14
|
-
const crossImport_1 = __importDefault(require("./crossImport"));
|
|
15
15
|
const DEFAULT_CONFIG_NAME = "rspack.config";
|
|
16
16
|
const registerLoader = (configPath) => {
|
|
17
17
|
const ext = path_1.default.extname(configPath);
|
package/dist/utils/profile.js
CHANGED
|
@@ -36,11 +36,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.applyProfile = void 0;
|
|
39
|
-
const
|
|
39
|
+
const core_1 = require("@rspack/core");
|
|
40
40
|
const fs_1 = __importDefault(require("fs"));
|
|
41
|
+
const inspector_1 = __importDefault(require("inspector"));
|
|
41
42
|
const path_1 = __importDefault(require("path"));
|
|
42
43
|
const url_1 = require("url");
|
|
43
|
-
const core_1 = require("@rspack/core");
|
|
44
44
|
const timestamp = Date.now();
|
|
45
45
|
const defaultOutputDirname = path_1.default.resolve(`.rspack-profile-${timestamp}`);
|
|
46
46
|
const defaultJSCPUProfileOutput = path_1.default.join(defaultOutputDirname, `./jscpuprofile.json`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-beta.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "CLI for rspack",
|
|
6
6
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"cross-env": "^7.0.3",
|
|
31
31
|
"execa": "^5.0.0",
|
|
32
32
|
"internal-ip": "6.2.0",
|
|
33
|
-
"@rspack/core": "0.
|
|
33
|
+
"@rspack/core": "0.7.0-beta.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@discoveryjs/json-ext": "^0.5.7",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"semver": "6.3.1",
|
|
42
42
|
"webpack-bundle-analyzer": "4.6.1",
|
|
43
43
|
"yargs": "17.6.2",
|
|
44
|
-
"@rspack/dev-server": "0.
|
|
44
|
+
"@rspack/dev-server": "0.7.0-beta.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "tsc -b ./tsconfig.build.json",
|