mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 01:17:16 +00:00
fix(bridge): support newer js targets with webpack (#3131)
This commit is contained in:
parent
0f9bcbf68f
commit
a9ba1ca907
@ -18,6 +18,8 @@
|
|||||||
"prepack": "unbuild"
|
"prepack": "unbuild"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
|
||||||
|
"@babel/plugin-proposal-optional-chaining": "^7.16.7",
|
||||||
"@babel/plugin-transform-typescript": "^7.16.8",
|
"@babel/plugin-transform-typescript": "^7.16.8",
|
||||||
"@nuxt/kit": "3.0.0",
|
"@nuxt/kit": "3.0.0",
|
||||||
"@nuxt/nitro": "3.0.0",
|
"@nuxt/nitro": "3.0.0",
|
||||||
|
@ -10,8 +10,6 @@ export function setupTypescript () {
|
|||||||
nuxt.options.extensions.push(...extensions)
|
nuxt.options.extensions.push(...extensions)
|
||||||
nuxt.options.build.additionalExtensions.push(...extensions)
|
nuxt.options.build.additionalExtensions.push(...extensions)
|
||||||
|
|
||||||
const _require = createRequire(import.meta.url)
|
|
||||||
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
|
// Error if `@nuxt/typescript-build` is added
|
||||||
@ -19,7 +17,12 @@ export function setupTypescript () {
|
|||||||
throw new Error('Please remove `@nuxt/typescript-build` from `buildModules` or set `bridge.typescript: false` to avoid conflict with bridge.')
|
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)
|
const _require = createRequire(import.meta.url)
|
||||||
|
nuxt.options.build.babel.plugins.unshift(
|
||||||
|
_require.resolve('@babel/plugin-proposal-optional-chaining'),
|
||||||
|
_require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'),
|
||||||
|
_require.resolve('@babel/plugin-transform-typescript')
|
||||||
|
)
|
||||||
|
|
||||||
extendWebpackConfig((config) => {
|
extendWebpackConfig((config) => {
|
||||||
config.resolve.extensions!.push(...extensions.map(e => `.${e}`))
|
config.resolve.extensions!.push(...extensions.map(e => `.${e}`))
|
||||||
|
@ -2565,6 +2565,8 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@nuxt/bridge@workspace:packages/bridge"
|
resolution: "@nuxt/bridge@workspace:packages/bridge"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@babel/plugin-proposal-nullish-coalescing-operator": ^7.16.7
|
||||||
|
"@babel/plugin-proposal-optional-chaining": ^7.16.7
|
||||||
"@babel/plugin-transform-typescript": ^7.16.8
|
"@babel/plugin-transform-typescript": ^7.16.8
|
||||||
"@nuxt/kit": 3.0.0
|
"@nuxt/kit": 3.0.0
|
||||||
"@nuxt/nitro": 3.0.0
|
"@nuxt/nitro": 3.0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user