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

Error compiling when importing sub asset from external module #1

Closed
Xli33 opened this issue May 2, 2023 · 2 comments · Fixed by #2
Closed

Error compiling when importing sub asset from external module #1

Xli33 opened this issue May 2, 2023 · 2 comments · Fixed by #2

Comments

@Xli33
Copy link

Xli33 commented May 2, 2023

this is the simple vite plugins config

plugins: [
      vue(),
      externals({
        vue: 'Vue',
        'vue-router': 'VueRouter',
        axios: 'axios',
        'view-ui-plus': 'ViewUIPlus'
        // pinia: 'Pinia',
        // 'vue-demi': 'VueDemi'
      }),
]

and i wanna import the locales from 'view-ui-plus' at node_module, so it's like this

import msgs from 'view-ui-plus/dist/locale/zh-CN'

however the import view-ui-plus/dist/locale/zh-CN is compiled to

http://localhost:8000/node_modules/.@yellowspot_vite-plugin-external/view-ui-plus.cjs/dist/locale/zh-CN

it's because the view-ui-plus is replaced with node_modules/.@yellowspot_vite-plugin-external/view-ui-plus.cjs

there's a reproduction here
image

┭┮﹏┭┮

@Xli33 Xli33 changed the title Error compiling when importing other asset from external module Error compiling when importing sub asset from external module May 2, 2023
@mgrunberg
Copy link
Member

@Xli33 thanks for reporting the issue. I released v0.2.0. It solves the issue.

@Xli33
Copy link
Author

Xli33 commented May 13, 2023

@Xli33 thanks for reporting the issue. I released v0.2.0. It solves the issue.

thanks for your great work ♪(・ω・)ノ

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 a pull request may close this issue.

2 participants