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

Passing down original sourcemap for flight client loader #40508

Merged
merged 4 commits into from Sep 13, 2022
Merged
Changes from 2 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
Expand Up @@ -16,12 +16,14 @@ function containsPath(parent: string, child: string) {

export default async function transformSource(
this: any,
source: string
): Promise<string> {
source: string,
map: any
) {
if (typeof source !== 'string') {
throw new Error('Expected source to have been transformed to a string.')
}

const callback = this.async()
const appDir = path.join(this.rootContext, 'app')
const isUnderAppDir = containsPath(appDir, this.resourcePath)
const filename = path.basename(this.resourcePath)
Expand Down Expand Up @@ -50,5 +52,7 @@ export default async function transformSource(
const { createProxy } = require("next/dist/build/webpack/loaders/next-flight-client-loader/module-proxy")\n
module.exports = createProxy(${JSON.stringify(this.resourcePath)})
`
return output
// Pass empty sourcemap
callback(null, output, map)
return
}