Unverified Commit 3d98171d authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Test webpack 5 beta (#15645)

parent 3b4d460a
...@@ -78,7 +78,7 @@ jobs: ...@@ -78,7 +78,7 @@ jobs:
- run: exit 0 - run: exit 0
testMacOS: testMacOS:
name: macOS ( Basic, Production, Acceptance ) name: macOS (Basic, Production, Acceptance)
runs-on: macos-latest runs-on: macos-latest
env: env:
NEXT_TELEMETRY_DISABLED: 1 NEXT_TELEMETRY_DISABLED: 1
...@@ -94,6 +94,23 @@ jobs: ...@@ -94,6 +94,23 @@ jobs:
- run: node run-tests.js test/integration/basic/test/index.test.js - run: node run-tests.js test/integration/basic/test/index.test.js
- run: node run-tests.js test/acceptance/* - run: node run-tests.js test/acceptance/*
testWebpack5:
name: webpack 5 (Basic, Production, Acceptance)
runs-on: ubuntu-latest
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
HEADLESS: true
steps:
- uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- run: cat package.json | jq '.resolutions.webpack = "^5.0.0-beta.22"' > package.json.tmp && mv package.json.tmp package.json
- run: yarn install --check-files
- run: node run-tests.js test/integration/production/test/index.test.js
- run: node run-tests.js test/integration/basic/test/index.test.js
- run: node run-tests.js test/acceptance/*
testFirefox: testFirefox:
name: Test Firefox (production) name: Test Firefox (production)
runs-on: ubuntu-latest runs-on: ubuntu-latest
......
...@@ -53,7 +53,7 @@ import WebpackConformancePlugin, { ...@@ -53,7 +53,7 @@ import WebpackConformancePlugin, {
ReactSyncScriptsConformanceCheck, ReactSyncScriptsConformanceCheck,
} from './webpack/plugins/webpack-conformance-plugin' } from './webpack/plugins/webpack-conformance-plugin'
import { WellKnownErrorsPlugin } from './webpack/plugins/wellknown-errors-plugin' import { WellKnownErrorsPlugin } from './webpack/plugins/wellknown-errors-plugin'
import FontStylesheetGatheringPlugin from './webpack/plugins/font-stylesheet-gathering-plugin'
type ExcludesFalse = <T>(x: T | false) => x is T type ExcludesFalse = <T>(x: T | false) => x is T
const isWebpack5 = parseInt(webpack.version!) === 5 const isWebpack5 = parseInt(webpack.version!) === 5
...@@ -984,7 +984,12 @@ export default async function getBaseWebpackConfig( ...@@ -984,7 +984,12 @@ export default async function getBaseWebpackConfig(
config.experimental.optimizeFonts && config.experimental.optimizeFonts &&
!dev && !dev &&
isServer && isServer &&
new FontStylesheetGatheringPlugin(), (function () {
const {
FontStylesheetGatheringPlugin,
} = require('./webpack/plugins/font-stylesheet-gathering-plugin')
return new FontStylesheetGatheringPlugin()
})(),
config.experimental.conformance && config.experimental.conformance &&
!isWebpack5 && !isWebpack5 &&
!dev && !dev &&
......
...@@ -15,7 +15,7 @@ interface VisitorMap { ...@@ -15,7 +15,7 @@ interface VisitorMap {
[key: string]: (path: NodePath) => void [key: string]: (path: NodePath) => void
} }
export default class FontStylesheetGatheringPlugin { export class FontStylesheetGatheringPlugin {
compiler?: Compiler compiler?: Compiler
gatheredStylesheets: Array<string> = [] gatheredStylesheets: Array<string> = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment