fix: resolve runtime provided dependencies

This commit is contained in:
Pooya Parsa 2020-11-04 14:52:12 +01:00
parent 5538f342f7
commit 16141efe25

View File

@ -32,6 +32,11 @@ export const getRollupConfig = (config) => {
'@vue/compiler-ssr' '@vue/compiler-ssr'
] ]
const providedDeps = [
'@nuxt/devalue',
'vue-bundle-renderer'
]
const extensions = ['.ts', '.mjs', '.js', '.json', '.node'] const extensions = ['.ts', '.mjs', '.js', '.json', '.node']
const external = [] const external = []
@ -87,7 +92,8 @@ export const getRollupConfig = (config) => {
'~renderer': require.resolve(path.resolve(RUNTIME_DIR, renderer)), '~renderer': require.resolve(path.resolve(RUNTIME_DIR, renderer)),
'~build': config.buildDir, '~build': config.buildDir,
'~mock': require.resolve(path.resolve(RUNTIME_DIR, 'mock')), '~mock': require.resolve(path.resolve(RUNTIME_DIR, 'mock')),
...mocks.reduce((p, c) => ({ ...p, [c]: '~mock' }), {}) ...mocks.reduce((p, c) => ({ ...p, [c]: '~mock' }), {}),
...providedDeps.reduce((p, c) => ({ ...p, [c]: require.resolve(c) }), {})
} }
})) }))