Package Exports
- hops
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hops) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Hops (CLI)
This package provides a binary (hops) that can be used to create and control Hops applications.
In order to create a new Hops application, it is recommended to install this package either globally (npm install --global hops or yarn global add hops and then hops init my-hops-project) or to use npx (npx hops init my-hops-project).
When the binary is executed outside of a Hops project, it will only expose one command init - which can be used to create a new Hops application based on a pre-defined template.
When this binary is executed inside a Hops application it exposes all commands that are provided by the installed Hops dependencies.
Installation
Install it globally to create a new Hops application.
Or install it locally in an already existing Hops application.
Install it globally via npm:
npm install --global hopsOr yarn
yarn global add hopsOr use npx:
npx hops init ...Install it locally to an existing Hops application:
npm install --save hopsOr:
yarn add hopsUsage
Bootstrapping a Project
hops init my-new-hops-project [--verbose] [--npm] [--template hops-template-*]This will create a very basic hops example project that is ready to go.
The following arguments are optional:
--verbose- to increase the verbosity of the output for debugging purposes--npm- to force usage ofnpminstead ofyarneven if yarn is available--template- to specify a different template for the intial structure. available templates:
Then cd into my-new-hops-project and execute hops --help again to see a list of supported commands.
Available Commands
hops build(provided byhops-build) - initiates a project build to generate browser and server JS bundleshops develop(provided byhops-build) - starts the webpack development server with hot code reloading for fast local iterationshops serve(provided byhops-express) - starts a production Node.js Express server using the generated JS bundle fromhops buildhops start- if NODE_ENV is set to production, this runshops buildandhops serve. Otherwisehops developis executed.
All commands accept additional arguments:
--production/-p- equivalent to settingNODE_ENVtoproduction--static/-s- to generate static HTML app shells for all configured hops locations.--clean/-c- defaults totrue, removes the build directory before initiating a build (n/a forhops serve)
hops only lists commands that are made available by other installed hops packages.
So for example hops build and hops develop are only available if hops-build is installed as a dependency in your project (hops-template-react includes it by default).
The command hops serve is only available if hops-express is installed as a dependency in your project (also included in the default react template).
And the command hops start is only available if hops-build and hops-express are installed as dependencies. To disable rebuilds in production mode, you must simply disable cleaning: hops start -p --clean=false.
Configuration
hops is being configured through hops-config.