From 0d0f34ba182010a881eb8ca9323f469dd3c938f7 Mon Sep 17 00:00:00 2001 From: Maia Teegarden Date: Fri, 10 Sep 2021 17:57:01 -0700 Subject: [PATCH] Pass code as buffer to swc minify (#29009) This should fix this: https://github.com/vercel/next.js/pull/28883/checks?check_run_id=3560578176#step:4:353 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes --- packages/next/build/swc/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/build/swc/index.js b/packages/next/build/swc/index.js index 3101f08da8..db1e84bab5 100644 --- a/packages/next/build/swc/index.js +++ b/packages/next/build/swc/index.js @@ -68,11 +68,11 @@ function toBuffer(t) { } export async function minify(src, opts) { - return bindings.minify(src, toBuffer(opts ?? {})) + return bindings.minify(toBuffer(src), toBuffer(opts ?? {})) } export function minifySync(src, opts) { - return bindings.minifySync(src, toBuffer(opts ?? {})) + return bindings.minifySync(toBuffer(src), toBuffer(opts ?? {})) } module.exports.transform = transform