Skip to content

Commit 009e908

Browse files
authored
fix(ui): turbopack with the latest next.js canary [skip lint] (#11280)
Fixes #11211 Disables prepending `"use client"` to `.map` files
1 parent 9fc1cd0 commit 009e908

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/ui/bundle.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ const useClientPlugin = {
3636

3737
result.outputFiles.forEach((file) => {
3838
let contents = file.text
39-
contents = contents.replace(directiveRegex, '') // Remove existing use client directives
40-
contents = directive + '\n' + contents // Prepend our use client directive
39+
40+
if (!file.path.endsWith('.map')) {
41+
contents = contents.replace(directiveRegex, '') // Remove existing use client directives
42+
contents = directive + '\n' + contents // Prepend our use client directive
43+
}
4144

4245
if (originalWrite) {
4346
const filePath = path.join(build.initialOptions.outdir, path.basename(file.path))

0 commit comments

Comments
 (0)