Skip to content

Commit

Permalink
fix: Fix the inaccurate judgment of vue.js (#2135)
Browse files Browse the repository at this point in the history
It can't preview the webpage in the VSCode when the project use ArcoVue(@arco-design/web-vue, a UI framework powered by ByteDance), because of the main JavaScript file's name is "@arco-design_web-vue.js".
  • Loading branch information
TanShun committed Nov 26, 2022
1 parent 05c84a0 commit aac3b00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/preview/bin/vite/config.ts
Expand Up @@ -318,7 +318,7 @@ config.plugins.push({
name: '__volar_preview',
transform(this, code, id, options?) {
const createAppText = 'createApp,';
if (id.indexOf('vue.js?') >= 0 && code.indexOf(createAppText) >= 0 && code.indexOf('__createAppProxy') === -1) {
if (id.indexOf('/vue.js?') >= 0 && code.indexOf(createAppText) >= 0 && code.indexOf('__createAppProxy') === -1) {
const createAppOffset = code.lastIndexOf(createAppText);
code =
code.substring(0, createAppOffset)
Expand Down

0 comments on commit aac3b00

Please sign in to comment.