From 189f24434eb36f8a2d6bfcd651b245a598dfbe31 Mon Sep 17 00:00:00 2001 From: Michel Tomas Date: Thu, 9 Dec 2021 22:36:15 +0100 Subject: [PATCH] fix: add IDEA workaround --- package.json | 3 +-- pnpm-lock.yaml | 10 +--------- src/core/ideHelper.ts | 5 ++++- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index be35cec6..123e87e4 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,6 @@ "local-pkg": "^0.4.0", "magic-string": "^0.25.7", "minimatch": "^3.0.4", - "pnpm": "^6.23.6", "resolve": "^1.20.0", "unplugin": "^0.2.21" }, @@ -112,4 +111,4 @@ "engines": { "node": ">=14" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cf1e68d9..2fb41dd4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,7 +28,6 @@ importers: local-pkg: ^0.4.0 magic-string: ^0.25.7 minimatch: ^3.0.4 - pnpm: ^6.23.6 resolve: ^1.20.0 rollup: ^2.60.0 ts-jest: ^27.0.7 @@ -46,7 +45,6 @@ importers: local-pkg: 0.4.0 magic-string: 0.25.7 minimatch: 3.0.4 - pnpm: 6.23.6 resolve: 1.20.0 unplugin: 0.2.21_rollup@2.60.0+vite@2.6.14 devDependencies: @@ -10217,12 +10215,6 @@ packages: - typescript dev: true - /pnpm/6.23.6: - resolution: {integrity: sha512-H6PIzO4W2zg2Jqms13uS5U3fU8yBdWk8rXcpJLjs/in+nutgVA8GGlasEAI2eAiTpc9FYJUkCklbJ4a/M36N0w==} - engines: {node: '>=12.17'} - hasBin: true - dev: false - /portfinder/1.0.28: resolution: {integrity: sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==} engines: {node: '>= 0.12.0'} @@ -13511,4 +13503,4 @@ packages: is-ci: 1.2.1 normalize-path: 1.0.0 strip-indent: 2.0.0 - dev: true + dev: true \ No newline at end of file diff --git a/src/core/ideHelper.ts b/src/core/ideHelper.ts index 7a31ff35..433b6c45 100644 --- a/src/core/ideHelper.ts +++ b/src/core/ideHelper.ts @@ -44,13 +44,16 @@ export async function generateIdeHelper(ctx: Context, root: string, filepath: st ` if (getVueVersion() === 'vue3') { + // @see https://youtrack.jetbrains.com/issue/WEB-48239 code += `import { createApp } from "vue"; ${lines.map(line => line[1]).join('\n')} const app = createApp({}); -${lines.map(line => `app.component('${line[0]}', ${line[0]})`).join('\n')} +const Vue = app + +${lines.map(line => `Vue.component('${line[0]}', ${line[0]});`).join('\n')} app.mount("body");