Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove md4 patch now that webpack has it in core #23703

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 0 additions & 11 deletions packages/config/src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,17 +520,6 @@ export function getNuxtConfig (_options) {
options.build.indicator = false
}

// Monkey patch crypto.createHash in dev/build to upgrade hashing fnction
if (parseInt(process.versions.node.slice(0, 2)) > 16 && !options.buildModules.some(m => m.name === 'patchMD4')) {
options.buildModules.push(function patchMD4 () {
const crypto = require('crypto')
const _createHash = crypto.createHash
crypto.createHash = function (algorithm, options) {
return _createHash(algorithm === 'md4' ? 'md5' : algorithm, options)
}
})
}

// Components Module
if (!options._start && getPKG('@nuxt/components')) {
options._modules.push('@nuxt/components')
Expand Down
1 change: 0 additions & 1 deletion packages/config/test/config/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ describe('config', () => {
UNIX_SOCKET: '/var/run/nuxt.sock'
}
const config = getDefaultNuxtConfig({ env })
config.buildModules = config.buildModules.filter(p => p.name !== 'patchMD4')
expect(config).toMatchSnapshot()
})
})
3 changes: 1 addition & 2 deletions packages/config/test/options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ describe('config: options', () => {
}
}
})
config.buildModules = config.buildModules.filter(p => p.name !== 'patchMD4')
expect(config).toMatchSnapshot()

process.cwd.mockRestore()
Expand Down Expand Up @@ -298,7 +297,7 @@ describe('config: options', () => {
const config = getNuxtConfig({ devModules: ['foo'], buildModules: ['bar'] })
expect(consola.warn).toHaveBeenCalledWith('`devModules` has been renamed to `buildModules` and will be removed in Nuxt 3.')
expect(config.devModules).toBe(undefined)
expect(config.buildModules.filter(p => p.name !== 'patchMD4')).toEqual(['bar', 'foo'])
expect(config.buildModules).toEqual(['bar', 'foo'])
})

test('should deprecate build.extractCSS.allChunks', () => {
Expand Down