diff --git a/packages/vite/rollup.config.js b/packages/vite/rollup.config.js index 4be0533f4404b7..8b1bda554695ad 100644 --- a/packages/vite/rollup.config.js +++ b/packages/vite/rollup.config.js @@ -161,14 +161,10 @@ const createNodeConfig = (isProduction) => { replacement: `: eval('require'),` } }), - // Optional peer deps of ws. Native deps that are mostly for performance. - // Since ws is not that perf critical for us, just ignore these deps. - ignoreDepPlugin({ - bufferutil: 1, - 'utf-8-validate': 1 - }), commonjs({ extensions: ['.js'], + // Optional peer deps of ws. Native deps that are mostly for performance. + // Since ws is not that perf critical for us, just ignore these deps. ignore: ['bufferutil', 'utf-8-validate'] }), json(), @@ -261,26 +257,6 @@ function shimDepsPlugin(deps) { } } -/** - * @type { (deps: Record) => import('rollup').Plugin } - */ -function ignoreDepPlugin(ignoredDeps) { - return { - name: 'ignore-deps', - resolveId(id) { - if (id in ignoredDeps) { - return id - } - }, - load(id) { - if (id in ignoredDeps) { - console.log(`ignored: ${id}`) - return '' - } - } - } -} - function licensePlugin() { return license({ thirdParty(dependencies) {