/spotlight-templates-react-redux

spotlight templates react+redux+router+ant环境

Primary LanguageJavaScriptMIT LicenseMIT

spotlight-templates-redux

spotlight scaffold template for react

Use:

spotlight redux my-project

cd my-project

 npm install

 npm run dev

 npm run build

此模板是react环境
This template is base on webpack, support for reactjs

1.配置在build/config.js 当中;
Configures in build/config.js

2.react + react-router + redux +ant

3.由于router使用的是history方式,build之后的代码需要放在根目录,不然就会404
Because the router mod is using "history". So after you run build , production code have to run at website's root path ,or all page is 404

如果使用的history路由需要做以下操作:
1)、在config.js中需要将dev和build的html5Router属性设置成true;
2)、gulp需要全局安装;
3)、此模板打包已支持Apache, 你只需要确认你的Apache开启rewrite功能(ngix 需要另外配置,如下);

location / {
    try_files $uri $uri/ /index.html;
}

4.Upgrade to webpack5

enjoy!