-
Notifications
You must be signed in to change notification settings - Fork 59
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
core-js降版本 #4
Labels
bug
Something isn't working
Comments
你这是打包新项目还是老项目? |
老项目 |
明白了,稍等一下,我刚才试了一下,通过插件的机制去修改有点问题。我修复一下这个bug先。 |
好咧,大佬加油~~~ |
lzxb
added a commit
that referenced
this issue
Jun 3, 2020
第一步,安装依赖 npm install @fmfe/genesis-core@0.0.59-alpha.0
npm install @fmfe/genesis-compiler@0.0.59-alpha.0 @babel/runtime-corejs2 -D 第二步,新增babel.ts文件 import { Plugin, BabelConfig } from '@fmfe/genesis-core';
export class BabelPlugin extends Plugin {
public babel(config: BabelConfig) {
config.presets.forEach((preset) => {
if (Array.isArray(preset) && preset[0] === '@babel/preset-env') {
// 修改 babel 配置
preset[1].corejs = 2;
}
});
}
} genesis.dev.ts 和 genesis.build.ts 使用这个插件 ssr.plugin.use(BabelPlugin); |
你看看能不能解决你的问题。我在本地试了一下ok |
相关文档,后续我补上。 |
可以的,已经解决了~ |
👌,有问题随时联系。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
发现项目里面用的是core3,如果我项目需要用core2,请问需要怎么配置呢?
The text was updated successfully, but these errors were encountered: