From 8b5159f3c0d291448b5a4433effe2048cfebf127 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 29 Jul 2022 13:50:02 +0100 Subject: [PATCH] fix(webpack): output `.mjs` to use crossorigin preloads (#6232) --- 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 8ee678b55d..25811bd077 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 d3b04e6c8a..bdd96611d7 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([])