1.0.3 • Published 2 years ago
wuzh v1.0.3
wuzh
react cli react compiler
usage
react build tool, Support Typescript
yarn add wuzh - package.json scripts
wu dev
wu build
// after you build, also you can startup service
wu serverYou can customize your compiler configuration in your root directory
- wu.config.js example:
const config = {
port: 9000,
defaultEntry: true,
defaultHtmlPlugin: true,
openBrowser: false,
writeToDisk: false,
publicPath: '/',
entry:null, // Object<webpackEntry> | null | array<webpackEntry>
proxy: {
'/api': {
target: 'http://localhost:3000',
pathRewrite: {'^/api': ''},
},
},
htmlPluginOption: [ // null | Array<object>
{
template: path.join(__dirname, './src/index.html'),
chunks: ['main', 'react'],
options
}
],
definePluginOption:{
'process.env.NODE_ENV': JSON.stringify('production'),
'definePlugin':JSON.stringify('definePlugin'),
},
hot: true,
liveReload: false
}
module.exports = configParameter description
| parameter | description |
|---|---|
| port | listener port ; default 9000 |
| open_browser | auto browser open page |
| default_entry | Use default entry /src/index.js ; default true |
| default_htmlPlugin | Use default htmlPlugin /src/index.html ; default true |
| writeToDisk | default false |
| publicPath | default '/' |
| entry | Object\<webpackEntry> / null when defaultEntry is false, customize yourself |
| proxy | Object\<webpackDevServerProxy> |
| htmlPluginOption | Array / null when defaultHtmlPlugin is false, customize yourself |
| definePluginOption | Object\<webpack.definePlugin.option>, when gun-pack dev , process.env.NODE_ENV default development, when gun-pack build , process.env.NODE_ENV default production |