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

bug: .umirc.ts文件执行两遍 #11226

Open
iYogic2 opened this issue May 29, 2023 · 1 comment
Open

bug: .umirc.ts文件执行两遍 #11226

iYogic2 opened this issue May 29, 2023 · 1 comment

Comments

@iYogic2
Copy link

iYogic2 commented May 29, 2023

Versions

  • dumi: dumi2
  • node: node14
  • npm: npm6
  • OS: mac
  • Browser: chrome

通过dumi脚手架创建项目后,在执行dumi dev或者dumi build的时候,.dumirc.ts文件执行两遍

.dumirc.ts文件代码如下

    import { defineConfig } from 'dumi';
    
    console.log("====>函数外部");
    
    function getPath() {
      console.log("函数内部!!!");
      return 'test';
    }
    
    export default defineConfig({
      outputPath: getPath(),
      themeConfig: {
        name: '',
      },
    });
image
@iYogic2 iYogic2 added the bug label May 29, 2023
@PeachScript
Copy link
Member

可以复现,但配置文件的返回值理应是稳定的,应该不会造成实质性影响;依赖 Umi 层调整配置文件初始化流程才能解决该问题,issue 将被转移到 Umi 仓库

@PeachScript PeachScript transferred this issue from umijs/dumi Jun 2, 2023
@PeachScript PeachScript changed the title bug: .dumirc.ts文件执行两遍 bug: .umirc.ts文件执行两遍 Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants