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

import在某些情况下 失效 #33

Open
maodouchen opened this issue Jun 20, 2022 · 0 comments
Open

import在某些情况下 失效 #33

maodouchen opened this issue Jun 20, 2022 · 0 comments

Comments

@maodouchen
Copy link

maodouchen commented Jun 20, 2022

Versions

Reproduction

配置vite方式

optimizeDeps.esbuildOptions = {
      plugins: [
        // lessLoader()
        esbuildCommonjs(['testA']),
      ],
    }

testA代码

const Form = require("testB");

testB中输出方式

export const Form = () => {}
export default function () {
    return ''
}

会报错找不到f2

https://github.com/originjs/vite-plugins/blob/main/packages/vite-plugin-commonjs/src/lib.ts#L37

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

No branches or pull requests

1 participant