@jpp-toolkit/plugin-build-react 0.0.93 → 0.0.95
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/index.d.mts +1 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +7 -7
- package/src/react-build-command.ts +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Command } from "@jpp-toolkit/core";
|
|
2
|
-
import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
|
|
3
2
|
|
|
4
3
|
//#region src/react-build-command.d.ts
|
|
5
4
|
declare class ReactBuildCommand extends Command {
|
|
6
5
|
static summary: string;
|
|
7
6
|
static flags: {
|
|
8
|
-
watch:
|
|
7
|
+
watch: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
8
|
};
|
|
10
9
|
static examples: {
|
|
11
10
|
description: string;
|
package/dist/index.mjs
CHANGED
|
@@ -38,7 +38,7 @@ const commands = { "build:react": class ReactBuildCommand extends Command {
|
|
|
38
38
|
}), "\n");
|
|
39
39
|
};
|
|
40
40
|
if (watch) {
|
|
41
|
-
const devServerOptions = config.devServer
|
|
41
|
+
const devServerOptions = typeof config.devServer === "object" ? config.devServer : {};
|
|
42
42
|
devServerOptions.hot = true;
|
|
43
43
|
await new RspackDevServer(devServerOptions, compiler).start();
|
|
44
44
|
} else compiler.run((error, stats) => {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/react-build-command.ts","../src/index.ts"],"sourcesContent":["import { Command } from '@jpp-toolkit/core';\nimport { createReactRspackConfig } from '@jpp-toolkit/rspack-config';\nimport { Flags } from '@oclif/core';\nimport type { MultiStats, Stats } from '@rspack/core';\nimport { rspack } from '@rspack/core';\nimport { RspackDevServer } from '@rspack/dev-server';\n\nexport class ReactBuildCommand extends Command {\n static override summary = 'Build React project using Rspack.';\n\n static override flags = {\n watch: Flags.boolean({\n char: 'w',\n description: 'Watch files for changes and rebuild automatically.',\n default: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Build the React project once.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Build the React project in watch mode.',\n command: '<%= config.bin %> <%= command.id %> --watch',\n },\n ];\n\n public async run(): Promise<void> {\n const {\n flags: { watch },\n } = await this.parse(ReactBuildCommand);\n\n const config = createReactRspackConfig(undefined, {\n isProduction: !watch,\n })({\n RSPACK_BUILD: !watch,\n RSPACK_SERVE: watch,\n });\n const compiler = rspack(config);\n\n const compilerCallback = (err: Error | null, stats: Stats | MultiStats | undefined) => {\n if (err) {\n this.logger.error(err.toString());\n return;\n }\n if (!stats) return;\n this.logger.log(stats.toString({ preset: 'normal', colors: true }), '\\n');\n };\n\n if (watch) {\n const devServerOptions = config.devServer
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/react-build-command.ts","../src/index.ts"],"sourcesContent":["import { Command } from '@jpp-toolkit/core';\nimport { createReactRspackConfig } from '@jpp-toolkit/rspack-config';\nimport { Flags } from '@oclif/core';\nimport type { MultiStats, Stats } from '@rspack/core';\nimport { rspack } from '@rspack/core';\nimport { RspackDevServer } from '@rspack/dev-server';\n\nexport class ReactBuildCommand extends Command {\n static override summary = 'Build React project using Rspack.';\n\n static override flags = {\n watch: Flags.boolean({\n char: 'w',\n description: 'Watch files for changes and rebuild automatically.',\n default: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Build the React project once.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Build the React project in watch mode.',\n command: '<%= config.bin %> <%= command.id %> --watch',\n },\n ];\n\n public async run(): Promise<void> {\n const {\n flags: { watch },\n } = await this.parse(ReactBuildCommand);\n\n const config = createReactRspackConfig(undefined, {\n isProduction: !watch,\n })({\n RSPACK_BUILD: !watch,\n RSPACK_SERVE: watch,\n });\n const compiler = rspack(config);\n\n const compilerCallback = (err: Error | null, stats: Stats | MultiStats | undefined) => {\n if (err) {\n this.logger.error(err.toString());\n return;\n }\n if (!stats) return;\n this.logger.log(stats.toString({ preset: 'normal', colors: true }), '\\n');\n };\n\n if (watch) {\n const devServerOptions = typeof config.devServer === 'object' ? config.devServer : {};\n devServerOptions.hot = true;\n const devServer = new RspackDevServer(devServerOptions, compiler);\n await devServer.start();\n } else {\n compiler.run((error: Error | null, stats: Stats | MultiStats | undefined) => {\n compiler.close((closeErr) => {\n if (closeErr) this.logger.error(closeErr.toString());\n compilerCallback(error, stats);\n });\n });\n }\n }\n}\n","import { ReactBuildCommand } from './react-build-command';\n\nexport const commands = {\n 'build:react': ReactBuildCommand,\n};\n"],"mappings":";;;;;;;ACEA,MAAa,WAAW,EACpB,eAAe,MDIN,0BAA0B,QAAQ;CAC3C,OAAgB,UAAU;CAE1B,OAAgB,QAAQ,EACpB,OAAO,MAAM,QAAQ;EACjB,MAAM;EACN,aAAa;EACb,SAAS;CACb,CAAC,EACL;CAEA,OAAgB,WAAW,CACvB;EACI,aAAa;EACb,SAAS;CACb,GACA;EACI,aAAa;EACb,SAAS;CACb,CACJ;CAEA,MAAa,MAAqB;EAC9B,MAAM,EACF,OAAO,EAAE,YACT,MAAM,KAAK,MAAM,iBAAiB;EAEtC,MAAM,SAAS,wBAAwB,KAAA,GAAW,EAC9C,cAAc,CAAC,MACnB,CAAC,EAAE;GACC,cAAc,CAAC;GACf,cAAc;EAClB,CAAC;EACD,MAAM,WAAW,OAAO,MAAM;EAE9B,MAAM,oBAAoB,KAAmB,UAA0C;GACnF,IAAI,KAAK;IACL,KAAK,OAAO,MAAM,IAAI,SAAS,CAAC;IAChC;GACJ;GACA,IAAI,CAAC,OAAO;GACZ,KAAK,OAAO,IAAI,MAAM,SAAS;IAAE,QAAQ;IAAU,QAAQ;GAAK,CAAC,GAAG,IAAI;EAC5E;EAEA,IAAI,OAAO;GACP,MAAM,mBAAmB,OAAO,OAAO,cAAc,WAAW,OAAO,YAAY,CAAC;GACpF,iBAAiB,MAAM;GAEvB,MAAM,IADgB,gBAAgB,kBAAkB,QAC1C,EAAE,MAAM;EAC1B,OACI,SAAS,KAAK,OAAqB,UAA0C;GACzE,SAAS,OAAO,aAAa;IACzB,IAAI,UAAU,KAAK,OAAO,MAAM,SAAS,SAAS,CAAC;IACnD,iBAAiB,OAAO,KAAK;GACjC,CAAC;EACL,CAAC;CAET;AACJ,EC7DA"}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jpp-toolkit/plugin-build-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.95",
|
|
4
4
|
"description": "Plugin that add the react build command to the jpp cli.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jpp",
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@oclif/core": "4.11.3",
|
|
38
|
-
"@rspack/core": "
|
|
39
|
-
"@rspack/dev-server": "
|
|
40
|
-
"@jpp-toolkit/core": "0.0.
|
|
41
|
-
"@jpp-toolkit/rspack-config": "0.0.
|
|
38
|
+
"@rspack/core": "2.0.3",
|
|
39
|
+
"@rspack/dev-server": "2.0.1",
|
|
40
|
+
"@jpp-toolkit/core": "0.0.55",
|
|
41
|
+
"@jpp-toolkit/rspack-config": "0.0.62"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"oclif": "4.23.
|
|
44
|
+
"oclif": "4.23.7"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": "24",
|
|
48
|
-
"pnpm": "
|
|
48
|
+
"pnpm": "11"
|
|
49
49
|
},
|
|
50
50
|
"volta": {
|
|
51
51
|
"extends": "../../package.json"
|
|
@@ -50,7 +50,7 @@ export class ReactBuildCommand extends Command {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
if (watch) {
|
|
53
|
-
const devServerOptions = config.devServer
|
|
53
|
+
const devServerOptions = typeof config.devServer === 'object' ? config.devServer : {};
|
|
54
54
|
devServerOptions.hot = true;
|
|
55
55
|
const devServer = new RspackDevServer(devServerOptions, compiler);
|
|
56
56
|
await devServer.start();
|