Giter Club home page Giter Club logo

builder's People

Contributors

alexmaze avatar codingstar avatar doxiaodong avatar geograous avatar georgebbbb avatar huangbinjie avatar liaoyu avatar luncher avatar nighca avatar raychenfj avatar surmon-china avatar torvaldssg avatar wangkechun avatar yinxulai avatar zenas-he avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

builder's Issues

common-chunks 有没有这种可能

  1. vendor: import 'jQuery'

  2. chunk1: $.ajax

  3. chunk2: $.ajax

  4. fec_common: $ajax

script: fec_common ($ is undefined)
script: vendor ($ defined here)

更灵活的 build config

现有的 dev / prod 不可能完全覆盖使用场景,经常会有诸如测试环境的 publicUrl 需要特别配置,beta 环境的某某配置需要与众不同等需求,这里收集下方案再决定怎么搞:

支持 js 形式的 build-config

build-config.js,使用其导出作为 build config

先排除,详情见 #6

支持更强大的 prepare

现在支持 build-prepare.sh,但在不使用 image 的情况下有环境兼容性问题,另外修改 build-config.json 也不方便

  1. build-prepare.js

    类似 build-prepare.sh,不过使用 node 执行,环境兼容性更好,操作 build-config.json 也能更便利

  2. 允许配置 addon 性质的 js 作为插件,动态修改 buildConfig 对象

    直接由 builder 引入并运行,实现一个 buildConfig 对象的转换函数即可

支持通过 cli 参数对 build-config.json 进行修正

  1. 添加 cli 参数 build-config:

    fec-builder build --build-config publicUrl="xxx"

    这里要考虑怎么支持复杂的配置值

  2. 允许通过 cli 参数指定 build config:

    fec-builder build --build-config ./build-config.beta.json

    这里考虑增强 extends,让 build-config.beta.json 可以 extends: "./build-config"

tsconfig.json & babelrc 等配置文件的定位

RT,现在稍微有点混乱,比如 babel 的配置会由 builder 传入,而不使用 babelrc;ts 的构建行为现在主要是 tsconfig.json 决定,而不是 builder,却会影响 builder 本身的行为;

需要整理一下,感觉还是需要放信息到外边配置文件里(比如编辑器需要读取 tsconfig.json 来决定自己的行为);但是这个配置文件的内容需要被 builder 检查或干脆由 builder 生成,不用开发者自己维护

相关项目: https://github.com/timarney/react-app-rewired

build-config 中添加字段指定 builder 版本号

如:(参考 package.json

{
  "engines": { "builder" : "1.3.0" }
}

可用于静态分析,提前决定 pull 的 builder 版本(如 jenkins / travis 中)。
注意考虑静态跟动态的权衡,对比 #6
build-config.json 至少有一部分内容是需要静态提供的。

支持 https dev server

有时候本地启动 https dev server 是必要的,比如后端 api 设置 cookie 可能会标志 secure,此时若 dev server 是 http 的,则 cookie 无法正确设置。

或者考虑自动将代理的 api 请求中 cookie 的 secure 标志去掉?

干掉 postcss.config.js

RT,配置其实是在内部传过去的,但是现在用的 postcss & postcss-loader 要求在项目目录下有一个这个文件,否则会报错。

干掉它。。

自动化发布

利用 travis 在 release 一个 tag 时做自动发布,发布行为包括:

  1. npm publish
  2. docker build & docker push hub.c.163.com/nighca/fec-builder
  3. kirk push?

fix image compress problem

图片压缩功能貌似不太稳定,先默认配置不打开吧

[2018-06-22 09:49:20.943] [ERROR] FEC - generate failed
[2018-06-22 09:49:20.945] [ERROR] FEC - ./src/common/components/PlatformIcon/os_icons.png
Module build failed: Error: Command failed: /fec/node_modules/pngquant-bin/vendor/pngquant --output /tmp/5b6970ef-49bc-495f-bc6f-b2e965156891 /tmp/81115384-6e34-4b75-b67b-4c5262ce671c --quality 65-90 --speed 4

    at Promise.all.then.arr (/fec/node_modules/exec-buffer/node_modules/execa/index.js:201:11)
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/common/components/PlatformIcon/index.tsx 9:16-41
 @ ./src/vm/components/TableItems/ImageItems.tsx
 @ ./src/vm/components/TableItems/index.ts
 @ ./src/vm/containers/BsnList/index.tsx
 @ ./src/vm/routes.ts
 @ ./src/vm/index.tsx
 @ ./src/routes.ts
 @ ./src/index.tsx

tree shaking

portal 用的配置("extends": "typescript-react")目前没有 tree shaking 的效果,需要检查并修复

可不可以在运行时重新加载 build-confg.json

RT。有时候开发的时候需要修改 build-config 的配置(devProxy神马的),每次都要重启下 fec-builder,时间会很长,可不可以提供一个在运行时按一个什么键,然后就重新加载 build-config 的功能?(会不会快一点😂)

图片压缩

目前默认的图片使用 file-loader 引入,在实际中应当再加上 image-webpack-loader 以压缩图片

支持通过参数启用 lint 检查

目前静态检查的错误不会出现在编译结果中,特别是 typescript 项目,希望能够支持每次 compile 时预先 lint 一边源码。

snapshot test

Use snapshot (of webpack config & webpack stats output) to test builder.

动态生成 build config 的方式

目前可以通过 build-prepare.sh 动态生成 build-config.json,考虑是不是需要允许 build-config 是个 js module,export 一个 object 作为 build config,甚至允许 export 一个 promise,resolve 结果作为 build config

entries 的支持

build config 中 pages 配置中的 entries 信息,应该支持字符串(当成仅有一项的数组)或数组。这里对字符串的支持有问题,需要提前对这个 entries 信息做处理,处理成统一的(数组)形式

api proxy 配置不当

配置:

{
  '/api': 'http://foobar.com'
}

应该生效为:

/api/* -> http://foobar.com/*

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.