Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于GitHub Pages #4

Open
programmer-yang opened this issue Jan 4, 2018 · 0 comments
Open

关于GitHub Pages #4

programmer-yang opened this issue Jan 4, 2018 · 0 comments

Comments

@programmer-yang
Copy link
Owner

programmer-yang commented Jan 4, 2018

最近开源了一个组件、文档、测试、发布解决方案,
是基于bisheng写的,在这个过程中研究了一下GitHub Pages

这里分享一篇文章

bisheng目前发布到GitHub Pages还存在一些问题,我提了个问题,可以在这里查看进度
后续看是否需要写一篇总结在这里
待续...


2018-01-08
目前问题已经解决,原来在bishengconfig中可以定义一个root节点,这个节点就是来设置路由前缀的,因为git pages上所有的目录都是xxx.github.io/xxx/这样的结构,所以需要设置一下路由的前缀。
像这样:

if (process.env.NODE_ENV) {
  bishengConfig.htmlTemplateExtraData = {
    root: '/component-factory/'
  };
  bishengConfig.root = '/component-factory/';
}

考虑到开发环境中是不需要设置htmlTemplateExtraDataroot节点的


如果使用的是create-react-app的话,就需要手动在package.json中配置homepage节点。编译过程中,程序会解析你这个配置,解析出路由前缀和资源前缀,详情参考我上边儿分享的那篇文章

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant