@100tal-seg/seg-react 中文文档教程
seg-react
用于 React 开发的 cli 工具。 文档。
Install
$ npm install seg-react -g
$ sr --help
Cli
推荐
$ mkdir ice-project
$ cd ice-project
$ sr init project # also support component/block
$ sr dev
$ sr build
$ sr add block
Methods
不推荐
init({ scaffold })
init project by scaffold:
const { init } = require('seg-react');
await init({
template: '@icedesign/lite-scaffold',
// Default: process.cwd()
projectDir: ''
// component/block/project, Default: project
type: ''
});
build({ customWebpackConfig, cliOptions })
build project:
const { build } = require('seg-react');
await build({
customWebpackConfig: {},
// ref to bin/ice-build.js
cliOptions: {}
});
seg-react
A cli tool for React Development. Docs.
Install
$ npm install seg-react -g
$ sr --help
Cli
Recommended
$ mkdir ice-project
$ cd ice-project
$ sr init project # also support component/block
$ sr dev
$ sr build
$ sr add block
Methods
Not recommended
init({ scaffold })
init project by scaffold:
const { init } = require('seg-react');
await init({
template: '@icedesign/lite-scaffold',
// Default: process.cwd()
projectDir: ''
// component/block/project, Default: project
type: ''
});
build({ customWebpackConfig, cliOptions })
build project:
const { build } = require('seg-react');
await build({
customWebpackConfig: {},
// ref to bin/ice-build.js
cliOptions: {}
});