UNPKG

@lynx-js/rspeedy

Version:

A webpack/rspack-based frontend toolchain for Lynx

49 lines (48 loc) 3.93 kB
export const __webpack_ids__ = [ "src_cli_commands_ts" ]; export const __webpack_modules__ = { "./src/cli/commands.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, { apply: ()=>apply }); var _version_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/version.ts"); function applyCommonOptions(command) { command.option('-c --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--env-mode <mode>', 'specify the env mode to load the .env.[mode] file').option('--no-env', 'disable loading `.env` files"').option('-m --mode <mode>', 'specify the build mode, can be `development`, `production` or `none`'); } function apply(program) { const cwd = process.cwd(); program.name('rspeedy').usage('<command> [options]').version(_version_js__WEBPACK_IMPORTED_MODULE_0__.version).option('--unmanaged', 'Force to use the unmanaged version of Rspeedy, instead of the locally installed.').showHelpAfterError(true).showSuggestionAfterError(true).exitOverride(); const buildCommand = program.command('build'); buildCommand.description('Build the project in production mode').option('--environment <name...>', 'specify the name of environment to build').action((buildOptions)=>__webpack_require__.e("src_cli_build_ts").then(__webpack_require__.bind(__webpack_require__, "./src/cli/build.ts")).then(({ build })=>build.call(buildCommand, cwd, buildOptions))); const devCommand = program.command('dev'); devCommand.description('Run the dev server and watch for source file changes while serving.').option('--base <base>', 'specify the base path of the server').option('--environment <name...>', 'specify the name of environment to build').action((devOptions)=>__webpack_require__.e("src_cli_dev_ts").then(__webpack_require__.bind(__webpack_require__, "./src/cli/dev.ts")).then(({ dev })=>dev.call(devCommand, cwd, devOptions))); const inspectCommand = program.command('inspect'); inspectCommand.description('View the Rsbuild config and Rspack config of the project.').option('--output <output>', 'specify inspect content output path').option('--verbose', 'show full function definitions in output').action((inspectOptions)=>__webpack_require__.e("src_cli_inspect_ts").then(__webpack_require__.bind(__webpack_require__, "./src/cli/inspect.ts")).then(({ inspect })=>inspect.call(inspectCommand, cwd, inspectOptions))); const previewCommand = program.command('preview'); previewCommand.description('Preview the production build outputs locally.').option('--base <base>', 'specify the base path of the server').action((previewOptions)=>__webpack_require__.e("src_cli_preview_ts").then(__webpack_require__.bind(__webpack_require__, "./src/cli/preview.ts")).then(({ preview })=>preview.call(previewCommand, cwd, previewOptions))); const commonCommands = [ devCommand, buildCommand, inspectCommand, previewCommand ]; commonCommands.forEach((command)=>applyCommonOptions(command)); return program; } }, "./src/version.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.d(__webpack_exports__, { version: ()=>version, rspackVersion: ()=>rspackVersion, rsbuildVersion: ()=>core_.version }); var core_ = __webpack_require__("@rsbuild/core"); var package_namespaceObject = { i8: "0.9.10" }; const version = package_namespaceObject.i8; const rspackVersion = core_.rspack.rspackVersion; } };