-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
升级babel到7 #1280
升级babel到7 #1280
Conversation
chenjun1011
commented
Jan 9, 2019
- 兼容 bizchart 报错 Uncaught TypeError: Cannot assign to read only property 'constructor' of object '#<Group>' BizCharts#583
- 跟 ice-scripts babel配置保持一致
useESModules: false, | ||
}, | ||
] | ||
: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种是项目级别特有的配置,构建运行时的,在这里无意义
'@babel/plugin-syntax-dynamic-import', | ||
'@babel/plugin-syntax-import-meta', | ||
['@babel/plugin-proposal-class-properties', { loose: true }], | ||
'@babel/plugin-proposal-json-strings', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
记得 babel 7 之后可以不用显示的配置这些,可以通过 babel-preset-env 判断引用关系去做处理,不建议直接从 ice-scripts 拷贝过来,拷贝过来有两个问题:1. 需要维护两份一样的东西,可能不太合理。2. 区块开发和项目开发的构建不一样
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些是 babel-preset-env 里不包括的
{ libraryName: '@icedesign/base' }, | ||
'@icedesign/base', | ||
], | ||
['babel-plugin-import', { libraryName: '@alife/next' }, '@alife/next'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这句代码可以去掉,不会使用 @alife/next,我们应该只推荐使用 @alifd/next @imsobear 确认下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有副作用的话可以先留着
|
||
function resolvePlugin(plugins) { | ||
return plugins.map((plugin) => { | ||
return plugins.filter(Boolean).map((plugin) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.filter(Boolean)
作用是什么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.