smartorigin/react-utils-bundle

用于部署和调试应用的 React 命令

dev-master 2018-08-31 14:59 UTC

This package is not auto-updated.

Last update: 2024-09-29 06:20:03 UTC


README

将 React 命令用于部署和调试应用至 Symfony 环境。
此包与 Symfony 3.X 版本兼容(可能也适用于 4.X,但未测试)。

先决条件

在使用此包的命令之前,您需要安装 npm 和 yarn(可选)。

配置

此包与 npm 或 yarn 命令行界面兼容。
您可以在 config.yml 文件中定义此路径

so_react_utils:
    npm_bin_path: /usr/bin/npm # default value
    yarn_bin_path: /usr/bin/yarn # default value

如何使用

此包提供 3 个命令

  • soreact_utils:npm:install : 使用 npm 安装 React 依赖项
  • soreact_utils:yarn:install : 使用 yarn 安装 React 依赖项
  • soreact_utils:npm:run : 运行 webpack 脚本
bin/console soreact_utils:npm:install @BundleName
# Argument1 : @BundleName : Name of the bundle who have the React Components to install *required*
# option1 : --timeout or -t : number of seconds before the process raise a timeout *optionnal* (default 300)
# option2 : --reactFolderPath or -p : path to react folder in the bundle *optionnal* (default ReactComponent)

bin/console soreact_utils:yarn:install @BundleName --timeout 1
# Argument1 : @BundleName : Name of the bundle who have the React Components to install *required*
# option1 : --timeout or -t : number of seconds before the process raise a timeout *optionnal* (default 300)
# option2 : --reactFolderPath or -p : path to react folder in the bundle *optionnal* (default ReactComponent)

bin/console soreact_utils:npm:run @BundleName webpackScript
# Argument1 : @BundleName : Name of the bundle who have the React Components to install *required*
# Argument1 : webpackScript : Name of the webpack script to run *required*
# option1 : --reactFolderPath or -p : path to react folder in the bundle *optionnal* (default ReactComponent)