mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 15:42:09 +00:00
fix(bridge): detect conflict with @nuxt/typescript-build
usage (#672)
This commit is contained in:
parent
2fc0829dd2
commit
ac16127a13
@ -13,6 +13,12 @@ export function setupTypescript () {
|
|||||||
const _require = createRequire(import.meta.url)
|
const _require = createRequire(import.meta.url)
|
||||||
const babelPlugin = _require.resolve('@babel/plugin-transform-typescript')
|
const babelPlugin = _require.resolve('@babel/plugin-transform-typescript')
|
||||||
nuxt.options.build.babel.plugins = nuxt.options.build.babel.plugins || []
|
nuxt.options.build.babel.plugins = nuxt.options.build.babel.plugins || []
|
||||||
|
|
||||||
|
// Error if `@nuxt/typescript-build` is added
|
||||||
|
if (nuxt.options.buildModules.includes('@nuxt/typescript-build')) {
|
||||||
|
throw new Error('Please remove `@nuxt/typescript-build` from `buildModules` or set `bridge.typescript: false` to avoid conflict with bridge.')
|
||||||
|
}
|
||||||
|
|
||||||
nuxt.options.build.babel.plugins.unshift(babelPlugin)
|
nuxt.options.build.babel.plugins.unshift(babelPlugin)
|
||||||
|
|
||||||
extendWebpackConfig((config) => {
|
extendWebpackConfig((config) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user