diff --git a/packages/next-server/server/render.js b/packages/next-server/server/render.js index 98d5d406b9c08..cbee517a9e8ad 100644 --- a/packages/next-server/server/render.js +++ b/packages/next-server/server/render.js @@ -26,6 +26,9 @@ function getDynamicImportBundles (manifest, moduleIds) { const logger = console +// since send doesn't support wasm yet +send.mime.define({ 'application/wasm': ['wasm'] }) + export async function render (req, res, pathname, query, opts) { const html = await renderToHTML(req, res, pathname, query, opts) sendHTML(req, res, html, req.method, opts) diff --git a/packages/next/build/webpack.js b/packages/next/build/webpack.js index d7c85323ff074..fb871e55f7057 100644 --- a/packages/next/build/webpack.js +++ b/packages/next/build/webpack.js @@ -197,7 +197,8 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i hotUpdateMainFilename: 'static/webpack/[hash].hot-update.json', // This saves chunks with the name given via `import()` chunkFilename: isServer ? `${dev ? '[name]' : '[name].[contenthash]'}.js` : `static/chunks/${dev ? '[name]' : '[name].[contenthash]'}.js`, - strictModuleExceptionHandling: true + strictModuleExceptionHandling: true, + webassemblyModuleFilename: 'static/wasm/[modulehash].wasm' }, performance: { hints: false }, resolve: resolveConfig, diff --git a/test/integration/export/pages/dynamic-imports.js b/test/integration/export/pages/dynamic-imports.js index 71a8351999590..b1eef236fa54c 100644 --- a/test/integration/export/pages/dynamic-imports.js +++ b/test/integration/export/pages/dynamic-imports.js @@ -1,7 +1,7 @@ import Link from 'next/link' import dynamic from 'next/dynamic' -const DynamicComponent = dynamic(import('../components/hello')) +const DynamicComponent = dynamic(() => import('../components/hello')) export default () => (