react-scripts-fdt
Configuration and scripts for Create React App.
Last updated a year ago by guoquan.yang .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install react-scripts-fdt 
SYNC missed versions from official npm registry.

基于官方create-react-app做了二次开发

  • add 默认为css预编译为less(css|less文件)
  • add 开启css modules
  • add prebuild 检查当前版号是否有tag存在
  • add externals 配置
    package.json
"externals": {
  "react": "React",
  "react-dom": "ReactDOM",
  "react-router-dom": "ReactRouterDOM"
}
  • add 本地mock
    api/index.js
  • add env 配置 .env文件
    .env.developmennt //开发环境
    .env.production //线上环境
REACT_APP_自定义变量

  • add 开关 文件是否带hash串
    .env文件
REACT_APP_HASHVERSION=true
  • add api 代理
    package.json
"proxy": {
  "/api": {
    "target": "http://xxx",
    "changeOrigin": true,
    "pathRewrite": {
      "^/api": ""
    }
  }
}

用法指南
因为less-loadercss-loader中的css modules 对相对路径的引用解析有冲突
参考issues

// css 文件
// error
class {
  background: url(./svg.logo);
}
// good 
class {
  background: url(\./svg.logo);
}

官方文档

This package includes scripts and configuration used by Create React App.
Please refer to its documentation:

Current Tags

  • 1.0.0                                ...           latest (a year ago)

5 Versions

  • 1.0.0                                ...           a year ago
  • 0.4.0                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 5
Last Month 2
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |