Skip to content

Commit

Permalink
ci: fix webpack 5 enabling for tests (#21436)
Browse files Browse the repository at this point in the history
* ci: fix webpack 5 enabling for tests

* refactor: move default location

* Disable incompatible suite
  • Loading branch information
Timer committed Jan 22, 2021
1 parent f2de5a0 commit 74b6389
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_test_deploy.yml
Expand Up @@ -160,7 +160,7 @@ jobs:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
HEADLESS: true
NEXT_WEBPACK5: 1
NEXT_PRIVATE_TEST_WEBPACK5_MODE: 1

steps:
- uses: actions/checkout@v2
Expand All @@ -174,7 +174,7 @@ jobs:
- run: yarn install --check-files
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs-only' }}

- run: xvfb-run node run-tests.js test/integration/{link-ref,production,basic,async-modules,font-optimization,ssr-ctx,worker-loader}/test/index.test.js test/acceptance/*.test.js
- run: xvfb-run node run-tests.js test/integration/{link-ref,production,basic,async-modules,font-optimization,ssr-ctx}/test/index.test.js test/acceptance/*.test.js
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs-only' }}

testLegacyReact:
Expand Down
6 changes: 1 addition & 5 deletions packages/next/build/webpack-config.ts
Expand Up @@ -204,11 +204,7 @@ export default async function getBaseWebpackConfig(
rewrites: Rewrite[]
}
): Promise<webpack.Configuration> {
initWebpack(
config.future?.webpack5 ||
(config.future?.webpack5 !== false &&
Number(process.env.NEXT_WEBPACK5) > 0)
)
initWebpack(!!config.future?.webpack5)

let plugins: PluginMetaData[] = []
let babelPresetPlugins: { dir: string; config: any }[] = []
Expand Down
2 changes: 1 addition & 1 deletion packages/next/next-server/server/config.ts
Expand Up @@ -91,7 +91,7 @@ const defaultConfig: NextConfig = {
future: {
strictPostcssConfiguration: false,
excludeDefaultMomentLocales: false,
webpack5: false,
webpack5: Number(process.env.NEXT_PRIVATE_TEST_WEBPACK5_MODE) > 0,
},
serverRuntimeConfig: {},
publicRuntimeConfig: {},
Expand Down

0 comments on commit 74b6389

Please sign in to comment.