CLI for sei code tools
npm install sei_code_tools
CLI for code tools come from sei company usage;
内部使用的。
命令行工具集合,方便源代码代码迁移改造。
When you have followed the Getting Started guide of webpack then webpack CLI is already installed!
使用方法:几个子命令的用法。
###
1,生成urql需要的json文件,执行 sei_code_tools urqlSchema -u http://localhost:8673/graphql src/common/urql-schema.json ;
``bash`
npx webpack-cli [command] [options]
If no command is specified then bundle command is used by default
To display basic commands and arguments -
`bash`
npx webpack-cli --help
To display all supported commands and arguments -
`bash`
npx webpack-cli --help=verbose
or
`bash`
npx webpack-cli --help verbose
``
build|bundle|b [entries...] [options] Run webpack (default command, can be omitted).
configtest|t [config-path] Validate a webpack configuration.
help|h [command] [option] Display help for commands and options.
info|i [options] Outputs information about your system.
serve|server|s [entries...] [options] Run the webpack dev server and watch for source file changes while serving.
version|v [options] Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.
watch|w [entries...] [options] Run webpack and watch for files changes.
`
Options:
-c, --config
--config-name
-m, --merge Merge two or more configurations using 'webpack-merge'.
--disable-interpret Disable interpret for loading the config file.
--env
--node-env
--config-node-env
--analyze It invokes webpack-bundle-analyzer plugin to get bundle information.
--progress [value] Print compilation progress during build.
-j, --json [pathToJsonFile] Prints result as JSON or store it in a file.
--fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack.
-d, --devtool
--no-devtool Negative 'devtool' option.
--entry
-e, --extends
--mode
--name
-o, --output-path
--stats [value] Stats options object or preset name.
--no-stats Negative 'stats' option.
-t, --target
--no-target Negative 'target' option.
-w, --watch Enter watch mode, which rebuilds on file change.
--no-watch Negative 'watch' option.
--watch-options-stdin Stop watching when stdin stream has ended.
--no-watch-options-stdin Negative 'watch-options-stdin' option.
Global options:
--color Enable colors on console.
--no-color Disable colors on console.
-v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.
-h, --help [verbose] Display help for commands and options.
`
Checkout OPTIONS.md to see list of all available options.
| Exit Code | Description |
| --------- | -------------------------------------------------- |
| 0 | Success |1
| | Errors from webpack |2
| | Configuration/options problem or an internal error |
| Environment Variable | Description |
| ----------------------------------- | ------------------------------------------------------------------- |
| WEBPACK_CLI_SKIP_IMPORT_LOCAL | when true it will skip using the local instance of webpack-cli. |WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG
| | when true it will force load the ESM config. |WEBPACK_PACKAGE
| | Use a custom webpack version in CLI. |WEBPACK_DEV_SERVER_PACKAGE
| | Use a custom webpack-dev-server version in CLI. |WEBPACK_CLI_HELP_WIDTH
| | Use custom width for help output. |
You can use the following environment variables inside your webpack configuration:
| Environment Variable | Description |
| -------------------- | -------------------------------------------- |
| WEBPACK_SERVE | true if serve\|s is being used. |WEBPACK_BUILD
| | true if build\|bundle\|b is being used. |WEBPACK_WATCH
| | true if --watch\|watch\|w is being used. |
Checkout webpack.js.org for more detailed documentation of webpack-cli`.
发布包:在目录PS D:\home\code_tools\packages\sei_code_tools> npm publish --access=public
开发调试: 在父工程目录中的package.json: 运行build。