mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(webpack): use lodash cloneDeep
again (#23888)
This commit is contained in:
parent
ba4361a0f0
commit
b63b4e58e8
@ -35,7 +35,7 @@
|
|||||||
"fs-extra": "^11.1.1",
|
"fs-extra": "^11.1.1",
|
||||||
"h3": "^1.8.2",
|
"h3": "^1.8.2",
|
||||||
"hash-sum": "^2.0.0",
|
"hash-sum": "^2.0.0",
|
||||||
"klona": "^2.0.6",
|
"lodash-es": "4.17.21",
|
||||||
"magic-string": "^0.30.5",
|
"magic-string": "^0.30.5",
|
||||||
"memfs": "^4.6.0",
|
"memfs": "^4.6.0",
|
||||||
"mini-css-extract-plugin": "^2.7.6",
|
"mini-css-extract-plugin": "^2.7.6",
|
||||||
|
@ -3,7 +3,7 @@ import webpack from 'webpack'
|
|||||||
import ForkTSCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
|
import ForkTSCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
|
||||||
import { logger } from '@nuxt/kit'
|
import { logger } from '@nuxt/kit'
|
||||||
import type { WebpackConfigContext } from '../utils/config'
|
import type { WebpackConfigContext } from '../utils/config'
|
||||||
import { applyPresets, getWebpackConfig } from '../utils/config'
|
import { applyPresets } from '../utils/config'
|
||||||
import { nuxt } from '../presets/nuxt'
|
import { nuxt } from '../presets/nuxt'
|
||||||
import { node } from '../presets/node'
|
import { node } from '../presets/node'
|
||||||
|
|
||||||
@ -20,8 +20,6 @@ export function server (ctx: WebpackConfigContext) {
|
|||||||
serverPreset,
|
serverPreset,
|
||||||
serverPlugins
|
serverPlugins
|
||||||
])
|
])
|
||||||
|
|
||||||
return getWebpackConfig(ctx)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function serverPreset (ctx: WebpackConfigContext) {
|
function serverPreset (ctx: WebpackConfigContext) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import type { Configuration } from 'webpack'
|
import type { Configuration } from 'webpack'
|
||||||
import type { Nuxt, NuxtOptions } from '@nuxt/schema'
|
import type { Nuxt, NuxtOptions } from '@nuxt/schema'
|
||||||
import { logger } from '@nuxt/kit'
|
import { logger } from '@nuxt/kit'
|
||||||
import { klona } from 'klona'
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
export interface WebpackConfigContext {
|
export interface WebpackConfigContext {
|
||||||
nuxt: Nuxt
|
nuxt: Nuxt
|
||||||
@ -68,5 +68,6 @@ export function fileName (ctx: WebpackConfigContext, key: string) {
|
|||||||
|
|
||||||
export function getWebpackConfig (ctx: WebpackConfigContext): Configuration {
|
export function getWebpackConfig (ctx: WebpackConfigContext): Configuration {
|
||||||
// Clone to avoid leaking config between Client and Server
|
// Clone to avoid leaking config between Client and Server
|
||||||
return klona(ctx.config)
|
// TODO: rewrite webpack implementation to avoid necessity for this
|
||||||
|
return cloneDeep(ctx.config)
|
||||||
}
|
}
|
||||||
|
@ -744,9 +744,9 @@ importers:
|
|||||||
hash-sum:
|
hash-sum:
|
||||||
specifier: ^2.0.0
|
specifier: ^2.0.0
|
||||||
version: 2.0.0
|
version: 2.0.0
|
||||||
klona:
|
lodash-es:
|
||||||
specifier: ^2.0.6
|
specifier: 4.17.21
|
||||||
version: 2.0.6
|
version: 4.17.21
|
||||||
magic-string:
|
magic-string:
|
||||||
specifier: ^0.30.5
|
specifier: ^0.30.5
|
||||||
version: 0.30.5
|
version: 0.30.5
|
||||||
@ -1120,6 +1120,7 @@ packages:
|
|||||||
/@babel/highlight@7.22.20:
|
/@babel/highlight@7.22.20:
|
||||||
resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==}
|
resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
requiresBuild: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/helper-validator-identifier': 7.22.20
|
'@babel/helper-validator-identifier': 7.22.20
|
||||||
chalk: 2.4.2
|
chalk: 2.4.2
|
||||||
@ -6424,6 +6425,7 @@ packages:
|
|||||||
|
|
||||||
/js-tokens@4.0.0:
|
/js-tokens@4.0.0:
|
||||||
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
|
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
|
||||||
|
requiresBuild: true
|
||||||
|
|
||||||
/js-yaml@3.14.1:
|
/js-yaml@3.14.1:
|
||||||
resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}
|
resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}
|
||||||
@ -6643,7 +6645,6 @@ packages:
|
|||||||
|
|
||||||
/lodash-es@4.17.21:
|
/lodash-es@4.17.21:
|
||||||
resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
|
resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
|
||||||
dev: true
|
|
||||||
|
|
||||||
/lodash.clonedeep@4.5.0:
|
/lodash.clonedeep@4.5.0:
|
||||||
resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==}
|
resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==}
|
||||||
|
Loading…
Reference in New Issue
Block a user