react app 开发cli工具,包括脚手架以及开发调试功能
$ sudo npm install silki -g
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 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
}
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",
}