react-build-cli
v0.2.4
Published
react
Downloads
43
Maintainers
Readme
react-build-cli
Installation
npm install -D react-build-cli
or
yarn add -D react-build-cli
Usage
react-build-cli start -m // -m local mock
react-build-cli build
react-build-cli test
Configation
- Custom webpack configuration, automatically overwrite the current webpack configuration (webpack.config.js)
webpack.config.prod.js and webpack.config.dev.js has a higher priority
- local mock (.mockrc.json)
interface MockConfig {
rootDir: string; // mock files
api: string; // api prefix
whiteList: string[]; // local mock whitlist
}
- rcb.config.js
interface RcbConfig {
host?: string; // dev server host
port?: number; // dev server port
proxy?: ProxyConfigMap | ProxyConfigArray, // dev server proxy
mock?: MockConfig, // mock config
babelPresets?: PluginItem[] | null, // add babel presets
babelPlugins?: PluginItem[] | null // add babel plugin
output?: Output; // output config
entry?: Entry; // entry config
devtool?: Configuration['devtool']; // devtool
alias?: { [key: string]: string }; // alias path
open?: boolean; // open browser
webpackPluginConfig?: HtmlWebpackPlugin.Options; // html-webpack-plugin config
webpack?: Configuration; // extra webpack
transpileDependencies?: any[]; // transpileDependencies
additionalModulePaths?: any[]; // additionalModulePaths
esModuleImage?: boolean; // 图片是否开启es模块
}