@gm-react-app/scripts
安装
Last updated 13 days ago by gmfe .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @gm-react-app/scripts 
SYNC missed versions from official npm registry.

使用

安装

yarn add @gm-react-app/scripts

迁移指引

gras migrate

之后跟着指引做就对了

说明

文件夹

my-project
  build/
  config/
    deploy.js
    local.js
    webpack.config.js
  src/
    index.js
    index.html
    svg/
      xxx.svg
  .eslintrc.js
  .gitignore
  .prettierrc.js
  .stylelintrc
  babel.config.js
  package.json
  yarn.lock

/build 构建产物

配置 /config/deploy.js /config/local.js

module.exports = {
  // 生产必填,开发默认 '/build/'
  publicPath: '//js.guanmai.cn/build/xxxx/',
  // 默认 8080
  port: 8080,
  // 默认不启用
  https: false,
  // 代理
  proxy: [
    {
      context: ['/xxxx', '/xxx'],
      target: 'url',
      changeOrigin: true,
    },
  ],
}

/config/webpack.config.js 如果修改 webpack 配置,提供此文件

入口 /src/index.js

模板 /src/index.html,支持 ejs 语法

svg svgr 只局限在 /svg 下,避免和其他 svg 冲突

babel

默认值解析 src/目录下和 node_modules/下的 gm-、@gmfe、@gm-touch,其他请联系作者 or 自行补充

css

less

style-jsx

其他

react-hot-loader

默认做了 alias

    alias: {
      // yarn link 后保持 react 一致
      react: path.resolve('react'),
      common: PATH.appDirectory + 'src/js/common/',
      stores: PATH.appDirectory + 'src/js/stores/',
      svg: PATH.appDirectory + 'src/svg/',
      img: PATH.appDirectory + 'src/img/'
    }

环境

process.env.NODE_ENV development test production
process.env.GIT_BRANCH
process.env.GIT_COMMIT

变量

__DEBUG__
__DEVELOPMENT__
__TEST__
__PRODUCTION__
__VERSION__ 来自 package.json version
__NAME__ 来自 package.json aliasName
__CLIENT_NAME__ 来自 package.json clientName
__BRANCH__
__COMMIT__

模板变量

htmlWebpackPlugin.options.branch
htmlWebpackPlugin.options.commit
htmlWebpackPlugin.options.env

Current Tags

  • 3.1.8-beta.0                                ...           beta (11 days ago)
  • 3.1.7                                ...           latest (13 days ago)

102 Versions

  • 3.1.8-beta.0                                ...           11 days ago
  • 3.1.7                                ...           13 days ago
  • 3.1.6                                ...           13 days ago
  • 3.1.5                                ...           16 days ago
  • 3.1.5-beta.0                                ...           16 days ago
  • 3.1.4                                ...           16 days ago
  • 3.1.3                                ...           18 days ago
  • 3.1.3-beta.5                                ...           18 days ago
  • 3.1.3-beta.4                                ...           23 days ago
  • 3.1.3-beta.3                                ...           23 days ago
  • 3.1.3-beta.2                                ...           23 days ago
  • 3.1.3-beta.1                                ...           23 days ago
  • 3.1.3-beta.0                                ...           23 days ago
  • 3.1.2                                ...           a month ago
  • 3.1.2-beta.0                                ...           a month ago
  • 3.1.1                                ...           a month ago
  • 3.1.0                                ...           a month ago
  • 3.0.6                                ...           a month ago
  • 3.0.6-beta.0                                ...           a month ago
  • 3.0.5                                ...           a month ago
  • 3.0.5-beta.1                                ...           a month ago
  • 3.0.5-beta.0                                ...           a month ago
  • 3.0.4                                ...           a month ago
  • 3.0.4-beta.2                                ...           a month ago
  • 3.0.4-beta.1                                ...           a month ago
  • 3.0.4-beta.0                                ...           a month ago
  • 3.0.3                                ...           a month ago
  • 3.0.2                                ...           a month ago
  • 3.0.1                                ...           a month ago
  • 3.0.1-alpha.0                                ...           a month ago
  • 3.0.0                                ...           a month ago
  • 3.0.0-rc.0                                ...           a month ago
  • 2.2.0-alpha.5                                ...           a month ago
  • 2.1.2                                ...           a month ago
  • 2.1.1-rc.0                                ...           a month ago
  • 2.2.0-alpha.4                                ...           a month ago
  • 2.2.0-alpha.3                                ...           a month ago
  • 2.2.0-alpha.2                                ...           a month ago
  • 2.2.0-alpha.1                                ...           2 months ago
  • 2.2.0-alpha.0                                ...           2 months ago
  • 2.1.1-alpha.13                                ...           2 months ago
  • 2.1.1-alpha.12                                ...           2 months ago
  • 2.1.1-alpha.11                                ...           2 months ago
  • 2.1.1-alpha.10                                ...           2 months ago
  • 2.1.1-alpha.9                                ...           2 months ago
  • 2.1.1-alpha.8                                ...           2 months ago
  • 2.1.1-alpha.7                                ...           2 months ago
  • 2.1.1-alpha.6                                ...           2 months ago
  • 2.1.1-alpha.5                                ...           2 months ago
  • 2.1.1-alpha.4                                ...           2 months ago
  • 2.1.1-alpha.3                                ...           2 months ago
  • 2.1.1-alpha.2                                ...           2 months ago
  • 2.1.1-alpha.1                                ...           2 months ago
  • 2.1.1-alpha.0                                ...           2 months ago
  • 2.0.5-alpha.5                                ...           2 months ago
  • 2.1.0                                ...           2 months ago
  • 2.0.6-alpha.2                                ...           2 months ago
  • 2.0.6-alpha.1                                ...           2 months ago
  • 2.0.6-alpha.0                                ...           2 months ago
  • 2.0.5-alpha.4                                ...           2 months ago
  • 2.0.5-alpha.3                                ...           2 months ago
  • 2.0.5-alpha.2                                ...           2 months ago
  • 2.0.5-alpha.1                                ...           2 months ago
  • 2.0.5-alpha.0                                ...           2 months ago
  • 2.0.4                                ...           2 months ago
  • 2.0.3                                ...           2 months ago
  • 2.0.3-alpha.0                                ...           2 months ago
  • 2.0.2                                ...           2 months ago
  • 2.0.1                                ...           2 months ago
  • 2.0.0                                ...           2 months ago
  • 1.3.2                                ...           2 months ago
  • 1.3.1                                ...           2 months ago
  • 1.3.0                                ...           2 months ago
  • 1.2.0                                ...           2 months ago
  • 1.1.13                                ...           2 months ago
  • 1.1.12                                ...           2 months ago
  • 1.2.0-alpha.1                                ...           2 months ago
  • 1.2.0-alpha.0                                ...           2 months ago
  • 1.1.11                                ...           2 months ago
  • 1.1.10                                ...           2 months ago
  • 1.1.9                                ...           2 months ago
  • 1.1.8                                ...           3 months ago
  • 1.1.7                                ...           3 months ago
  • 1.1.6                                ...           3 months ago
  • 1.1.5                                ...           3 months ago
  • 1.1.4                                ...           3 months ago
  • 1.1.3                                ...           3 months ago
  • 1.1.2                                ...           3 months ago
  • 1.1.1                                ...           3 months ago
  • 1.1.0                                ...           3 months ago
  • 1.0.2                                ...           3 months ago
  • 1.0.1                                ...           3 months ago
  • 1.0.0                                ...           3 months ago
  • 0.1.3                                ...           3 months ago
  • 0.1.2                                ...           3 months ago
  • 0.1.1                                ...           3 months ago
  • 0.1.0                                ...           3 months ago
  • 0.0.6                                ...           3 months ago
  • 0.0.5                                ...           3 months ago
  • 0.0.3                                ...           3 months ago
  • 0.0.2                                ...           3 months ago
  • 0.0.1                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 343
Last Day 0
Last Week 104
Last Month 647
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |