0.1.8 • Published 7 years ago

generator-react-menu v0.1.8

Weekly downloads
87
License
MIT
Repository
github
Last release
7 years ago

generator-react-menu

基于react+redux+react-router+es6+webpack的项目目录生成器

准备工具

  • node 最新稳定版
  • yeoman npm install -g yo

安装脚手架

npm install generator-react-menu -g

生成脚手架

mkdir reactApp
cd reactApp/
yo react-menu // 注意不能再加generator前缀,yeoman会自动匹配

命令成功执行后,reactApp文件夹中会生成项目目录

===================

运行项目

node server.js

打包命令

  1. npm run build-test
  2. npm run build-pro

代理配置

server.js

const proxyOpts = proxy('/api',{
    target: 'http://xxx.xxx.com',
    changeOrigin: true,
    ws: true,
    pathRewrite: {
        '^/api': ''
    },
    router: {
        'http://xxx.xxx.com': 'http://localhost:3000'
    }
});
app.use('/api', proxyOpts);

日志配置

src/store/configureStore.js

if (process.env.NODE_ENV === 'production') {
    module.exports = require('./configureStore.prod')
} else {
    module.exports = require('./configureStore.dev')
}

TODO

  1. 项目生成 区分移动端 & PC端
0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago