From 8e5ea5d695dfc5aa4d2586734cc767dd9a1b9c3b Mon Sep 17 00:00:00 2001 From: Andy Bitz Date: Thu, 27 Sep 2018 22:14:55 +0200 Subject: [PATCH 1/4] Set a default path for wasm modules --- build/webpack.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/webpack.js b/build/webpack.js index b82abb1d84199..da19a5e17ebe0 100644 --- a/build/webpack.js +++ b/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, From bda183e8f3035edfc7b1f1ddf1c44a5c426039b0 Mon Sep 17 00:00:00 2001 From: Andy Bitz Date: Thu, 27 Sep 2018 22:15:34 +0200 Subject: [PATCH 2/4] Added the mimetype "application/wasm" for wasm files --- server/render.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/render.js b/server/render.js index 115970fb5fe71..ce1c57a99fa7b 100644 --- a/server/render.js +++ b/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) From 47613caccf51a7963c5a52ba61b24ac3758311a3 Mon Sep 17 00:00:00 2001 From: Andy Bitz Date: Fri, 28 Sep 2018 08:52:33 +0200 Subject: [PATCH 3/4] Upgrade write-file-webpack-plugin to 4.4.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0e9cd4e4bee7..6c21bda7520d1 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "webpack-hot-middleware": "2.22.3", "webpack-sources": "1.2.0", "webpackbar": "2.6.3", - "write-file-webpack-plugin": "4.3.2" + "write-file-webpack-plugin": "4.4.1" }, "devDependencies": { "@babel/preset-flow": "7.0.0", From 79613587c3e7fc86ad8e0397dd826c41feb6ab2e Mon Sep 17 00:00:00 2001 From: Andy Bitz Date: Tue, 2 Oct 2018 09:20:56 +0200 Subject: [PATCH 4/4] Made dynamic(import()) in test to dynamic(() => import()) --- test/integration/export/pages/dynamic-imports.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 () => (