@jpp-toolkit/plugin-build-react 0.0.9 → 0.0.11
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.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
- package/src/react-build-command.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -23,7 +23,7 @@ var ReactBuildCommand = class ReactBuildCommand extends Command {
|
|
|
23
23
|
const { flags: { watch } } = await this.parse(ReactBuildCommand);
|
|
24
24
|
const config = createReactRspackConfig(void 0, { isProduction: !watch })({
|
|
25
25
|
RSPACK_BUILD: !watch,
|
|
26
|
-
|
|
26
|
+
RSPACK_SERVE: watch
|
|
27
27
|
});
|
|
28
28
|
const compiler = rspack(config);
|
|
29
29
|
const compilerCallback = (err, 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
|
|
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 ?? {};\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":";;;;;;;AAOA,IAAa,oBAAb,MAAa,0BAA0B,QAAQ;CAC3C,OAAgB,UAAU;CAE1B,OAAgB,QAAQ,EACpB,OAAO,MAAM,QAAQ;EACjB,MAAM;EACN,aAAa;EACb,SAAS;EACZ,CAAC,EACL;CAED,OAAgB,WAAW,CACvB;EACI,aAAa;EACb,SAAS;EACZ,EACD;EACI,aAAa;EACb,SAAS;EACZ,CACJ;CAED,MAAa,MAAqB;EAC9B,MAAM,EACF,OAAO,EAAE,YACT,MAAM,KAAK,MAAM,kBAAkB;EAEvC,MAAM,SAAS,wBAAwB,QAAW,EAC9C,cAAc,CAAC,OAClB,CAAC,CAAC;GACC,cAAc,CAAC;GACf,cAAc;GACjB,CAAC;EACF,MAAM,WAAW,OAAO,OAAO;EAE/B,MAAM,oBAAoB,KAAmB,UAA0C;AACnF,OAAI,KAAK;AACL,SAAK,OAAO,MAAM,IAAI,UAAU,CAAC;AACjC;;AAEJ,OAAI,CAAC,MAAO;AACZ,QAAK,OAAO,IAAI,MAAM,SAAS;IAAE,QAAQ;IAAU,QAAQ;IAAM,CAAC,EAAE,KAAK;;AAG7E,MAAI,OAAO;GACP,MAAM,mBAAmB,OAAO,aAAa,EAAE;AAC/C,oBAAiB,MAAM;AAEvB,SADkB,IAAI,gBAAgB,kBAAkB,SAAS,CACjD,OAAO;QAEvB,UAAS,KAAK,OAAqB,UAA0C;AACzE,YAAS,OAAO,aAAa;AACzB,QAAI,SAAU,MAAK,OAAO,MAAM,SAAS,UAAU,CAAC;AACpD,qBAAiB,OAAO,MAAM;KAChC;IACJ;;;;;;AC5Dd,MAAa,WAAW,EACpB,eAAe,mBAClB"}
|
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.11",
|
|
4
4
|
"description": "Plugin that add the react build command to the jpp cli.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jpp",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@jpp-toolkit/rspack-config": "0.0.20"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"oclif": "4.22.
|
|
44
|
+
"oclif": "4.22.70"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": "24",
|