diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 766d0776c33f95f..570da75d6e1bc57 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -1561,7 +1561,9 @@ export default async function getBaseWebpackConfig( webpackConfig = await buildConfiguration(webpackConfig, { rootDirectory: dir, - customAppFile: new RegExp(path.join(pagesDir, `_app`)), + customAppFile: new RegExp( + path.join(pagesDir, `_app`).replace(/\\/g, '(/|\\\\)') + ), isDevelopment: dev, isServer, assetPrefix: config.assetPrefix || '', diff --git a/test/integration/css-client-nav/test/index.test.js b/test/integration/css-client-nav/test/index.test.js index 986e60d5f01c93d..8c58f7905ca73f7 100644 --- a/test/integration/css-client-nav/test/index.test.js +++ b/test/integration/css-client-nav/test/index.test.js @@ -64,7 +64,7 @@ function runTests(dev) { if (!dev) { // Ensure only `/blue` page's CSS is preloaded const serverCssPreloads = $('link[rel="preload"][as="style"]') - expect(serverCssPreloads.length).toBe(1) + expect(serverCssPreloads.length).toBe(2) const serverCssPrefetches = $('link[rel="prefetch"][as="style"]') expect(serverCssPrefetches.length).toBe(0) diff --git a/test/integration/css-fixtures/multi-module/pages/_app.js b/test/integration/css-fixtures/multi-module/pages/_app.js new file mode 100644 index 000000000000000..793aca2ac143a20 --- /dev/null +++ b/test/integration/css-fixtures/multi-module/pages/_app.js @@ -0,0 +1,5 @@ +import './global.css' + +export default function MyApp({ Component, pageProps }) { + return +} diff --git a/test/integration/css-fixtures/multi-module/pages/global.css b/test/integration/css-fixtures/multi-module/pages/global.css new file mode 100644 index 000000000000000..f540ffb7b7ffa23 --- /dev/null +++ b/test/integration/css-fixtures/multi-module/pages/global.css @@ -0,0 +1,3 @@ +html { + background: grey; +} diff --git a/test/integration/production/test/security.js b/test/integration/production/test/security.js index 76b15b72c2ca08c..f86eb81862eb8a6 100644 --- a/test/integration/production/test/security.js +++ b/test/integration/production/test/security.js @@ -1,4 +1,5 @@ /* eslint-env jest */ +/* global browserName */ import webdriver from 'next-webdriver' import { readFileSync } from 'fs' import url from 'url' @@ -343,23 +344,25 @@ module.exports = (context) => { expect(hostname).not.toBe('example.com') }) - it('should not execute script embedded inside svg image', async () => { - let browser - try { - browser = await webdriver(context.appPort, '/svg-image') - await browser.eval(`document.getElementById("img").scrollIntoView()`) - expect(await browser.elementById('img').getAttribute('src')).toContain( - 'xss.svg' - ) - expect(await browser.elementById('msg').text()).toBe('safe') - browser = await webdriver( - context.appPort, - '/_next/image?url=%2Fxss.svg&w=256&q=75' - ) - expect(await browser.elementById('msg').text()).toBe('safe') - } finally { - if (browser) await browser.close() - } - }) + if (browserName !== 'internet explorer') { + it('should not execute script embedded inside svg image', async () => { + let browser + try { + browser = await webdriver(context.appPort, '/svg-image') + await browser.eval(`document.getElementById("img").scrollIntoView()`) + expect( + await browser.elementById('img').getAttribute('src') + ).toContain('xss.svg') + expect(await browser.elementById('msg').text()).toBe('safe') + browser = await webdriver( + context.appPort, + '/_next/image?url=%2Fxss.svg&w=256&q=75' + ) + expect(await browser.elementById('msg').text()).toBe('safe') + } finally { + if (browser) await browser.close() + } + }) + } }) }