Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

I use the @ symbol into the img src, page is the error that the require('@/src/asset/logo.png') is not undefined #21

Closed
yanghuilong opened this issue Jan 21, 2021 · 0 comments · Fixed by viniciuskneves/vite-vue2#2

Comments

@yanghuilong
Copy link

   if (devServer) {
        return code + `\nexport { render, staticRenderFns }`;
    }
    // rewrite require calls to import on build
    return transformRequireToImport(code) + `\nexport { render, staticRenderFns }`;

I found (devserver) the code at above, the development is not call the [transformRequireToImport] method.

@yanghuilong yanghuilong changed the title I use the @ symbol into the img src, page is the error that the require('@/src/assert/logo.png') is not undefined I use the @ symbol into the img src, page is the error that the require('@/src/asset/logo.png') is not undefined Jan 21, 2021
@underfin underfin reopened this Jan 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.