Skip to content

Commit

Permalink
fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz committed Feb 24, 2022
1 parent 4946f94 commit 3ae5fdf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Expand Up @@ -11,7 +11,7 @@ const MiddlewareWasmLoader: webpack.loader.Loader = function (
_sourceMap
) {
const name = `wasm_${sha1(source)}`
const filePath = `middleware-chunks/${name}.wasm`
const filePath = `server/middleware-chunks/${name}.wasm`
const binding: WasmBinding = { filePath, name }
this._module.buildInfo.nextWasmMiddlewareBinding = binding
this.emitFile(`/${filePath}`, source, null)
Expand Down
Expand Up @@ -3,7 +3,7 @@ import { sources, webpack5 } from 'next/dist/compiled/webpack/webpack'
import { normalizePagePath } from '../../../server/normalize-page-path'
import { FUNCTIONS_MANIFEST } from '../../../shared/lib/constants'
import { getPageFromPath } from '../../entries'
import { collectAssets, getEntrypointInfo } from './middleware-plugin'
import { collectAssets, getEntrypointInfo, PerRoute } from './middleware-plugin'

const PLUGIN_NAME = 'FunctionsManifestPlugin'
export interface FunctionsManifest {
Expand Down Expand Up @@ -52,15 +52,15 @@ export default class FunctionsManifestPlugin {
createAssets(
compilation: webpack5.Compilation,
assets: any,
envPerRoute: Map<string, string[]>,
perRoute: PerRoute,
isEdgeRuntime: boolean
) {
const functionsManifest: FunctionsManifest = {
version: 1,
pages: {},
}

const infos = getEntrypointInfo(compilation, envPerRoute, isEdgeRuntime)
const infos = getEntrypointInfo(compilation, perRoute, isEdgeRuntime)
infos.forEach((info) => {
const { page } = info
// TODO: use global default runtime instead of 'web'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/webpack/plugins/middleware-plugin.ts
Expand Up @@ -51,7 +51,7 @@ function getPageFromEntrypointName(pagePath: string) {
return page
}

type PerRoute = {
export type PerRoute = {
envPerRoute: Map<string, string[]>
wasmPerRoute: Map<string, WasmBinding[]>
}
Expand Down

0 comments on commit 3ae5fdf

Please sign in to comment.