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

升级babel到7 #1280

Merged
merged 4 commits into from
Jan 9, 2019
Merged

升级babel到7 #1280

merged 4 commits into from
Jan 9, 2019

Conversation

chenjun1011
Copy link
Collaborator

@CLAassistant
Copy link

CLAassistant commented Jan 9, 2019

CLA assistant check
All committers have signed the CLA.

useESModules: false,
},
]
: null,
Copy link
Collaborator

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',
Copy link
Collaborator

@chenbin92 chenbin92 Jan 9, 2019

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. 区块开发和项目开发的构建不一样

Copy link
Collaborator Author

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'],
Copy link
Collaborator

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 确认下

Copy link
Collaborator

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) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.filter(Boolean) 作用是什么?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

处理这种情况

image

@imsobear imsobear merged commit 06fb416 into master Jan 9, 2019
@delete-merged-branch delete-merged-branch bot deleted the ice-devtools-babel-config branch January 9, 2019 05:54
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

Successfully merging this pull request may close these issues.

4 participants