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

按需引入时的打包问题 #41

Closed
leungwensen opened this issue Jan 17, 2018 · 3 comments · Fixed by #46
Closed

按需引入时的打包问题 #41

leungwensen opened this issue Jan 17, 2018 · 3 comments · Fixed by #46
Labels

Comments

@leungwensen
Copy link
Member

  • F2 Version: all
  • Platform: all

目前只提供了 ES6 的源码,当用户在项目里配置了 babel-loader 忽略 node_modules 文件夹时,最终打包出来的文件有问题。

解决方案:

  1. 在 webpack 配置里,把 f2 加到 babel 的打包列表中;
  2. 提供一个 ES5 版本的源码 lib 文件夹
@simaQ
Copy link
Contributor

simaQ commented Jan 18, 2018

大湿兄,这两种方案有具体的区别吗?

@leungwensen
Copy link
Member Author

方案一是目前用户碰到按需引入问题的解决方法,用户在用的时候配置 webpack、babel
方案二是我们发布前打包好 lib 文件夹,让用户直接引用 require('@antv/f2/lib/xxx.js'), 不需要再配置 babel。

标准的 npm 包应该都要提供方案二的解法,下周过去几个包我统一做一下构建

@simaQ
Copy link
Contributor

simaQ commented Jan 18, 2018

恩,点赞!~

This was referenced Jan 18, 2018
@simaQ simaQ closed this as completed in #46 Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants