fix(nuxt): use vue-devtools-stub to mock @vue/devtools-api for both cjs + esm (#6713)

This commit is contained in:
Daniel Roe 2022-08-17 16:44:36 +02:00 committed by GitHub
parent 99c960fb05
commit 405629dc35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View File

@ -68,6 +68,7 @@
"untyped": "^0.4.5", "untyped": "^0.4.5",
"vue": "^3.2.37", "vue": "^3.2.37",
"vue-bundle-renderer": "^0.4.2", "vue-bundle-renderer": "^0.4.2",
"vue-devtools-stub": "^0.1.0",
"vue-router": "^4.1.3" "vue-router": "^4.1.3"
}, },
"devDependencies": { "devDependencies": {

View File

@ -82,7 +82,7 @@ export async function initNitro (nuxt: Nuxt) {
'@vue/compiler-core': 'unenv/runtime/mock/proxy', '@vue/compiler-core': 'unenv/runtime/mock/proxy',
'@vue/compiler-dom': 'unenv/runtime/mock/proxy', '@vue/compiler-dom': 'unenv/runtime/mock/proxy',
'@vue/compiler-ssr': 'unenv/runtime/mock/proxy', '@vue/compiler-ssr': 'unenv/runtime/mock/proxy',
'@vue/devtools-api': 'unenv/runtime/mock/proxy-cjs', '@vue/devtools-api': 'vue-devtools-stub',
// Paths // Paths
'#paths': resolve(distDir, 'core/runtime/nitro/paths'), '#paths': resolve(distDir, 'core/runtime/nitro/paths'),

View File

@ -21,8 +21,11 @@
</template> </template>
<script setup> <script setup>
import { setupDevtoolsPlugin } from '@vue/devtools-api'
import { useRuntimeConfig } from '#imports' import { useRuntimeConfig } from '#imports'
setupDevtoolsPlugin({}, () => {})
const config = useRuntimeConfig() const config = useRuntimeConfig()
// reset title template example // reset title template example

View File

@ -10191,6 +10191,7 @@ __metadata:
untyped: ^0.4.5 untyped: ^0.4.5
vue: ^3.2.37 vue: ^3.2.37
vue-bundle-renderer: ^0.4.2 vue-bundle-renderer: ^0.4.2
vue-devtools-stub: ^0.1.0
vue-meta: next vue-meta: next
vue-router: ^4.1.3 vue-router: ^4.1.3
bin: bin:
@ -13684,6 +13685,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"vue-devtools-stub@npm:^0.1.0":
version: 0.1.0
resolution: "vue-devtools-stub@npm:0.1.0"
checksum: 3f19fa2ab6d7f65de459f6c10d8f1d682dcd4ac55934c37617423d4a70efb98aa0a35f290120ec0c429ddcc0bdb7458836f87763ee0b8acfe007e4869f67dbbb
languageName: node
linkType: hard
"vue-eslint-parser@npm:^8.0.1": "vue-eslint-parser@npm:^8.0.1":
version: 8.3.0 version: 8.3.0
resolution: "vue-eslint-parser@npm:8.3.0" resolution: "vue-eslint-parser@npm:8.3.0"