Skip to content

Latest commit

 

History

History
101 lines (70 loc) · 1.41 KB

README.md

File metadata and controls

101 lines (70 loc) · 1.41 KB

silk

Introduction

react app 开发cli工具,包括脚手架以及开发调试功能

view on github

Installation

$ sudo npm install silki -g

Usage

new a react multiple page app

$ silk new

new a react app page

$ silk page <name>

new a react app component

$ silk cpnt <name>

build code & start a develop server

$ silk server

build code to file, default to ./build folder

$ silk build

show help

$ silk -h

show version

$ silk --version

Configuration

  • Configuration is stored in the .silkrc file
  • JSON format, comments allowed

Default configuration:

{
  "entry": "src/pages/**/index.js",
  "disableCSSModules": false,
  "publicPath": "/",
  "outputPath": "./build",
  "extraBabelPlugins": [],
  "extraPostCSSPlugins": [],
  "autoprefixer": null,
  "proxy": null,
  "externals": null,
  "multipage": true,
  "define": null,
  "env": null,
  "theme": null,
  "port": 8000
}

entry

An entry is a starting point of a page. The entry property specify a webpack entry property. see webpack entry. The difference between silkrc and webpack config is that silk entry support glob. An example is seen below:

.silkrc

{
  "entry": "src/pages/**/index.js",
}

Advanced features

Mock