smash-cli

smash-cli

  • Documentation
  • Examples
  • Blog
  • GitHub

›Usage

Usage

  • Using a template
  • Using a middleware

Contribute

  • Writing a template
  • Writing a middleware
Edit

Using a template

We are going to download smash-template-react and run the dev-server task on it.

Make sure you have installed smash-cli.

Download it first

$ mkdir demo && cd demo
$ smash download smash-template-react

Don't forget to install its own dependencies.

$ npm i

How to use?

Read the .smash/task.yml

Here is what .smash/task.yml looks like:

# Start webpack-dev-server
dev-server:
  - name: smash-middleware-webpack-v4
    type: dev-server

We can find a task named dev-server. And a middleware named smash-middleware-webpack-v4 was used in it.

Install middleware

Run the command below to install the middleware.

$ smash install

Run a task

Now, run the dev-server task:

$ smash run dev-server

It starts the webpack-dev-server. A few minutes later, you will see a page opened in your browser.

OK! You finished it.

Using a middleware →
  • Download it first
  • How to use?
    • Read the .smash/task.yml
    • Install middleware
    • Run a task
smash-cli
Documentation
Getting StartedMiddlewaresTemplatesProgrammatic APIs
Examples
UsageContribute
Community
HelpUser ShowcaseIssuesYuque
More
BlogStar
Facebook Open Source
Copyright © 2020 www.smash-cli.com
粤ICP备18035177号-2 | 粤公网安备 44011302002170号