react app 开发cli工具,包括脚手架以及开发调试功能
$ sudo npm install silki -gnew a react multiple page app
$ silk newnew a react app page
$ silk page <name>new a react app component
$ silk cpnt <name>build code & start a develop server
$ silk serverbuild code to file, default to ./build folder
$ silk buildshow help
$ silk -hshow 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",
}