From a4eae91117761d0341fa87119dd3d9053eb231e0 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 29 Jul 2022 13:18:38 +0100 Subject: [PATCH 1/3] fix(webpack): output `.mjs` and use crossorigin preloads --- packages/schema/src/config/webpack.ts | 4 ++-- test/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/schema/src/config/webpack.ts b/packages/schema/src/config/webpack.ts index 8ee678b55d8..25811bd077c 100644 --- a/packages/schema/src/config/webpack.ts +++ b/packages/schema/src/config/webpack.ts @@ -122,8 +122,8 @@ export default { * ``` */ filenames: { - app: ({ isDev }) => isDev ? `[name].js` : `[contenthash:7].js`, - chunk: ({ isDev }) => isDev ? `[name].js` : `[contenthash:7].js`, + app: ({ isDev }) => isDev ? `[name].mjs` : `[contenthash:7].mjs`, + chunk: ({ isDev }) => isDev ? `[name].mjs` : `[contenthash:7].mjs`, css: ({ isDev }) => isDev ? '[name].css' : 'css/[contenthash:7].css', img: ({ isDev }) => isDev ? '[path][name].[ext]' : 'img/[name].[contenthash:7].[ext]', font: ({ isDev }) => isDev ? '[path][name].[ext]' : 'fonts/[name].[contenthash:7].[ext]', diff --git a/test/utils.ts b/test/utils.ts index d3b04e6c8a9..bdd96611d78 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -42,7 +42,7 @@ export async function expectNoClientErrors (path: string) { const { pageErrors, consoleLogs } = await renderPage(path) const consoleLogErrors = consoleLogs.filter(i => i.type === 'error') - const consoleLogWarnings = consoleLogs.filter(i => i.type === 'warn') + const consoleLogWarnings = consoleLogs.filter(i => i.type === 'warning') expect(pageErrors).toEqual([]) expect(consoleLogErrors).toEqual([]) From 1e64619c67a90ad2fce12e106173f3afadff55a1 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 29 Jul 2022 13:36:56 +0100 Subject: [PATCH 2/3] test: test for `warn` too --- test/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.ts b/test/utils.ts index bdd96611d78..ca0ecf1c25d 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -42,7 +42,7 @@ export async function expectNoClientErrors (path: string) { const { pageErrors, consoleLogs } = await renderPage(path) const consoleLogErrors = consoleLogs.filter(i => i.type === 'error') - const consoleLogWarnings = consoleLogs.filter(i => i.type === 'warning') + const consoleLogWarnings = consoleLogs.filter(i => ['warning', 'warn'].includes(i.type)) expect(pageErrors).toEqual([]) expect(consoleLogErrors).toEqual([]) From 910ce3b4a9075eccc6bd7ee1a64f45df08b5432c Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Fri, 29 Jul 2022 14:49:34 +0200 Subject: [PATCH 3/3] Update test/utils.ts --- test/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.ts b/test/utils.ts index ca0ecf1c25d..bdd96611d78 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -42,7 +42,7 @@ export async function expectNoClientErrors (path: string) { const { pageErrors, consoleLogs } = await renderPage(path) const consoleLogErrors = consoleLogs.filter(i => i.type === 'error') - const consoleLogWarnings = consoleLogs.filter(i => ['warning', 'warn'].includes(i.type)) + const consoleLogWarnings = consoleLogs.filter(i => i.type === 'warning') expect(pageErrors).toEqual([]) expect(consoleLogErrors).toEqual([])