Skip to content

Commit dadfaa1

Browse files
authored
Revert "Add a --webpack flag and default --turbopack to true (#84216)" (#84348)
1 parent 8586cdf commit dadfaa1

File tree

14 files changed

+146
-357
lines changed

14 files changed

+146
-357
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ jobs:
502502
503503
export NEXT_TEST_MODE=start
504504
export NEXT_TEST_WASM=true
505-
export IS_WEBPACK_TEST=1
506505
node run-tests.js \
507506
test/production/pages-dir/production/test/index.test.ts \
508507
test/e2e/streaming-ssr/index.test.ts
@@ -712,7 +711,7 @@ jobs:
712711

713712
secrets: inherit
714713

715-
test-dev: # TODO: rename to include webpack
714+
test-dev:
716715
name: test dev
717716
needs: ['optimize-ci', 'changes', 'build-native', 'build-next']
718717
if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }}
@@ -729,7 +728,6 @@ jobs:
729728
uses: ./.github/workflows/build_reusable.yml
730729
with:
731730
afterBuild: |
732-
export IS_WEBPACK_TEST=1
733731
export NEXT_TEST_MODE=dev
734732
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
735733
@@ -754,10 +752,8 @@ jobs:
754752

755753
uses: ./.github/workflows/build_reusable.yml
756754
with:
757-
# Should this be using turbopack? a variation?
758755
afterBuild: |
759756
export NEXT_TEST_MODE=dev
760-
export IS_WEBPACK_TEST=1
761757
762758
node run-tests.js \
763759
test/e2e/app-dir/app/index.test.ts \
@@ -784,7 +780,6 @@ jobs:
784780
with:
785781
nodeVersion: 20.9.0
786782
afterBuild: |
787-
export IS_WEBPACK_TEST=1
788783
node run-tests.js \
789784
--concurrency 4 \
790785
test/production/pages-dir/production/test/index.test.ts \
@@ -813,7 +808,6 @@ jobs:
813808
with:
814809
afterBuild: |
815810
export NEXT_TEST_MODE=start
816-
export IS_WEBPACK_TEST=1
817811
818812
node run-tests.js --type production \
819813
test/e2e/app-dir/app/index.test.ts \
@@ -842,7 +836,6 @@ jobs:
842836
uses: ./.github/workflows/build_reusable.yml
843837
with:
844838
afterBuild: |
845-
export IS_WEBPACK_TEST=1
846839
export NEXT_TEST_MODE=start
847840
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
848841
@@ -882,7 +875,6 @@ jobs:
882875
with:
883876
nodeVersion: 20.9.0
884877
afterBuild: |
885-
export IS_WEBPACK_TEST=1
886878
export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
887879
888880
node run-tests.js \
@@ -904,7 +896,6 @@ jobs:
904896
905897
# these all run without concurrency because they're heavier
906898
export TEST_CONCURRENCY=1
907-
export IS_WEBPACK_TEST=1
908899
909900
BROWSER_NAME=firefox node run-tests.js \
910901
test/production/pages-dir/production/test/index.test.ts
@@ -932,7 +923,6 @@ jobs:
932923
afterBuild: |
933924
export __NEXT_EXPERIMENTAL_PPR=true
934925
export NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json"
935-
export IS_WEBPACK_TEST=1
936926
937927
node run-tests.js \
938928
--timings \
@@ -955,7 +945,6 @@ jobs:
955945
export __NEXT_EXPERIMENTAL_PPR=true
956946
export NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json"
957947
export NEXT_TEST_MODE=dev
958-
export IS_WEBPACK_TEST=1
959948
960949
node run-tests.js \
961950
--timings \
@@ -979,7 +968,6 @@ jobs:
979968
export __NEXT_EXPERIMENTAL_PPR=true
980969
export NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json"
981970
export NEXT_TEST_MODE=start
982-
export IS_WEBPACK_TEST=1
983971
984972
node run-tests.js \
985973
--timings \
@@ -1002,7 +990,6 @@ jobs:
1002990
export __NEXT_EXPERIMENTAL_PPR=true # for compatibility with the existing tests
1003991
export __NEXT_EXPERIMENTAL_CACHE_COMPONENTS=true
1004992
export NEXT_EXTERNAL_TESTS_FILTERS="test/experimental-tests-manifest.json"
1005-
export IS_WEBPACK_TEST=1
1006993
1007994
node run-tests.js \
1008995
--timings \
@@ -1027,7 +1014,6 @@ jobs:
10271014
export NEXT_EXTERNAL_TESTS_FILTERS="test/experimental-tests-manifest.json"
10281015
export NEXT_TEST_MODE=dev
10291016
export __NEXT_EXPERIMENTAL_ISOLATED_DEV_BUILD=true
1030-
export IS_WEBPACK_TEST=1
10311017
10321018
node run-tests.js \
10331019
--timings \
@@ -1052,7 +1038,6 @@ jobs:
10521038
export __NEXT_EXPERIMENTAL_CACHE_COMPONENTS=true
10531039
export NEXT_EXTERNAL_TESTS_FILTERS="test/experimental-tests-manifest.json"
10541040
export NEXT_TEST_MODE=start
1055-
export IS_WEBPACK_TEST=1
10561041
10571042
node run-tests.js \
10581043
--timings \

bench/heavy-npm-deps/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"private": true,
55
"scripts": {
66
"dev-turbopack": "next dev --turbopack",
7-
"dev-webpack": "next dev --webpack",
7+
"dev-webpack": "next dev",
88
"build-turbopack": "next build --turbopack",
9-
"build-webpack": "next build --webpack",
9+
"build-webpack": "next build",
1010
"start-turbopack": "next start",
1111
"start-webpack": "next start",
1212
"build-application": "next build",

bench/module-cost/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"scripts": {
44
"prepare-bench": "node scripts/prepare-bench.mjs",
55
"benchmark": "node scripts/benchmark-runner.mjs",
6-
"dev-webpack": "next dev --webpack",
7-
"dev-turbopack": "next dev --turbopack",
8-
"build-webpack": "next build --webpack",
9-
"build-turbopack": "next build --turbopack",
6+
"dev-webpack": "next dev",
7+
"dev-turbopack": "next dev --turbo",
8+
"build-webpack": "next build",
9+
"build-turbopack": "next build --turbo",
1010
"start": "next start"
1111
},
1212
"devDependencies": {

package.json

Lines changed: 23 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,49 +17,29 @@
1717
"ci:publish": "tsx ./scripts/release/publish-npm.ts",
1818
"test-types": "tsc",
1919
"test-unit": "jest test/unit/ packages/next/ packages/font",
20-
"test-dev-inner": "cross-env NEXT_TEST_MODE=dev pnpm testheadless",
21-
"test-dev": "pnpm run test-dev-webpack",
22-
"test-dev-webpack": "pnpm run with-webpack pnpm test-dev-inner",
23-
"test-dev-experimental-inner": "pnpm run with-experimental pnpm test-dev-inner",
24-
"test-dev-experimental": "pnpm run test-dev-experimental-webpack",
25-
"test-dev-experimental-webpack": "pnpm run with-webpack pnpm test-dev-experimental-inner",
26-
"test-dev-rspack": "pnpm run with-rspack pnpm run test-dev-inner",
27-
"test-dev-experimental-rspack": "pnpm run with-rspack pnpm run test-dev-experimental-inner",
28-
"test-dev-turbo": "cross-env IS_TURBOPACK_TEST=1 TURBOPACK_DEV=1 pnpm test-dev-inner",
29-
"test-dev-experimental-turbo": "cross-env IS_TURBOPACK_TEST=1 TURBOPACK_DEV=1 pnpm run with-experimental pnpm test-dev-inner",
30-
"test-start-inner": "cross-env NEXT_TEST_MODE=start pnpm testheadless",
31-
"test-start": "pnpm run test-start-webpack",
32-
"test-start-webpack": "pnpm run with-webpack pnpm run test-start-inner",
33-
"test-start-experimental-inner": "pnpm run with-experimental pnpm test-start-inner",
34-
"test-start-experimental": "pnpm run test-start-experimental-webpack",
35-
"test-start-experimental-webpack": "pnpm run with-webpack pnpm run test-start-experimental-inner",
36-
"test-start-rspack": "pnpm run with-rspack pnpm run test-start-inner",
37-
"test-start-experimental-rspack": "pnpm run with-rspack pnpm run test-start-experimental-inner",
38-
"test-start-turbo": "cross-env IS_TURBOPACK_TEST=1 TURBOPACK_BUILD=1 pnpm test-start-inner",
39-
"test-start-experimental-turbo": "cross-env IS_TURBOPACK_TEST=1 TURBOPACK_BUILD=1 pnpm run with-experimental pnpm test-start-experimental-inner",
40-
"test-deploy-inner": "cross-env NEXT_TEST_MODE=deploy pnpm testheadless",
41-
"test-deploy": "pnpm run test-deploy-webpack",
42-
"test-deploy-webpack": "pnpm run with-webpack pnpm test-deploy-inner",
43-
"test-deploy-turbo": "cross-env IS_TURBOPACK_TEST=1 TURBOPACK_BUILD=1 pnpm test-deploy-inner",
44-
"testonly-dev-inner": "cross-env NEXT_TEST_MODE=dev pnpm testonly",
45-
"testonly-dev": "pnpm run testonly-dev-webpack",
46-
"testonly-dev-webpack": "pnpm run with-webpack pnpm run testonly-dev-inner",
47-
"testonly-dev-rspack": "pnpm run with-rspack pnpm run testonly-dev-inner",
48-
"testonly-dev-turbo": "cross-env IS_TURBOPACK_TEST=1 TURBOPACK_DEV=1 pnpm testonly-dev-inner",
49-
"testonly-start-inner": "cross-env NEXT_TEST_MODE=start pnpm testonly",
50-
"testonly-start": "pnpm run testonly-start-webpack",
51-
"testonly-start-webpack": "pnpm run with-webpack pnpm run testonly-start-inner",
52-
"testonly-start-rspack": "pnpm run with-rspack pnpm run testonly-start-inner",
53-
"testonly-start-turbo": "cross-env IS_TURBOPACK_TEST=1 TURBOPACK_BUILD=1 pnpm testonly-start-inner",
54-
"testonly-deploy-inner": "cross-env NEXT_TEST_MODE=deploy pnpm testonly",
55-
"testonly-deploy": "pnpm run testonly-deploy-webpack",
56-
"testonly-deploy-webpack": "pnpm run with-webpack pnpm run testonly-deploy-inner",
57-
"testonly-deploy-turbo": "cross-env IS_TURBOPACK_TEST=1 TURBOPACK_BUILD=1 pnpm testonly-deploy-inner",
58-
"test-inner": "pnpm testheadless",
59-
"test": "pnpm test-webpack",
60-
"test-webpack": "pnpm run with-webpack pnpm run test-inner",
61-
"test-rspack": "pnpm run with-rspack pnpm run test-inner",
62-
"test-turbo": "cross-env IS_TURBOPACK_TEST=1 TURBOPACK_DEV=1 TURBOPACK_BUILD=1 pnpm test-inner",
20+
"test-dev": "cross-env NEXT_TEST_MODE=dev pnpm testheadless",
21+
"test-dev-experimental": "cross-env NEXT_TEST_MODE=dev pnpm run with-experimental pnpm testheadless",
22+
"test-dev-rspack": "pnpm run with-rspack pnpm run test-dev",
23+
"test-dev-experimental-rspack": "pnpm run with-rspack pnpm run test-dev-experimental",
24+
"test-dev-turbo": "cross-env NEXT_TEST_MODE=dev IS_TURBOPACK_TEST=1 TURBOPACK_DEV=1 pnpm testheadless",
25+
"test-dev-experimental-turbo": "cross-env NEXT_TEST_MODE=dev IS_TURBOPACK_TEST=1 TURBOPACK_DEV=1 pnpm run with-experimental pnpm testheadless",
26+
"test-start": "cross-env NEXT_TEST_MODE=start pnpm testheadless",
27+
"test-start-experimental": "cross-env NEXT_TEST_MODE=start pnpm run with-experimental pnpm testheadless",
28+
"test-start-rspack": "pnpm run with-rspack pnpm run test-start",
29+
"test-start-experimental-rspack": "pnpm run with-rspack pnpm run test-start-experimental",
30+
"test-start-turbo": "cross-env NEXT_TEST_MODE=start IS_TURBOPACK_TEST=1 TURBOPACK_BUILD=1 pnpm testheadless",
31+
"test-start-experimental-turbo": "cross-env NEXT_TEST_MODE=start IS_TURBOPACK_TEST=1 TURBOPACK_BUILD=1 pnpm run with-experimental pnpm testheadless",
32+
"test-deploy": "cross-env NEXT_TEST_MODE=deploy pnpm testheadless",
33+
"testonly-dev": "cross-env NEXT_TEST_MODE=dev pnpm testonly",
34+
"testonly-dev-rspack": "pnpm run with-rspack pnpm run testonly-dev",
35+
"testonly-dev-turbo": "cross-env NEXT_TEST_MODE=dev IS_TURBOPACK_TEST=1 TURBOPACK_DEV=1 pnpm testonly",
36+
"testonly-start": "cross-env NEXT_TEST_MODE=start pnpm testonly",
37+
"testonly-start-rspack": "pnpm run with-rspack pnpm run testonly-start",
38+
"testonly-start-turbo": "cross-env NEXT_TEST_MODE=start IS_TURBOPACK_TEST=1 TURBOPACK_BUILD=1 pnpm testonly",
39+
"testonly-deploy": "cross-env NEXT_TEST_MODE=deploy pnpm testonly",
40+
"test": "pnpm testheadless",
41+
"test-rspack": "pnpm run with-rspack pnpm run test",
42+
"test-turbo": "cross-env IS_TURBOPACK_TEST=1 TURBOPACK_DEV=1 TURBOPACK_BUILD=1 pnpm testheadless",
6343
"testonly": "jest --runInBand",
6444
"testheadless": "cross-env HEADLESS=true pnpm testonly",
6545
"genstats": "cross-env LOCAL_STATS=true node .github/actions/next-stats-action/src/index.js",
@@ -109,7 +89,6 @@
10989
"build-storybook": "turbo run build-storybook",
11090
"test-storybook": "turbo run test-storybook",
11191
"with-rspack": "cross-env NEXT_RSPACK=1 NEXT_TEST_USE_RSPACK=1",
112-
"with-webpack": "cross-env IS_WEBPACK_TEST=1",
11392
"with-experimental": "cross-env __NEXT_EXPERIMENTAL_CACHE_COMPONENTS=true __NEXT_EXPERIMENTAL_PPR=true"
11493
},
11594
"devDependencies": {

packages/next-rspack/index.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
module.exports = function withRspack(config) {
22
process.env.NEXT_RSPACK = 'true'
33
process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent'
4-
if (process.env.TURBOPACK === 'auto') {
5-
// If next has defaulted to turbopack, override it.
6-
delete process.env.TURBOPACK
7-
} else if (process.env.TURBOPACK) {
8-
console.error('Cannot call withRspack and pass the --turbopack flag.')
9-
console.error('Please configure only one bundler.')
10-
process.exit(1)
11-
}
124
return config
135
}

packages/next/src/bin/next.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,8 @@ program
133133
.option('--no-mangling', 'Disables mangling.')
134134
.option('--profile', 'Enables production profiling for React.')
135135
.option('--experimental-app-only', 'Builds only App Router routes.')
136-
.option('--turbo', 'Builds using Turbopack.')
137-
.option('--turbopack', 'Builds using Turbopack.')
138-
.option('--webpack', 'Builds using webpack.')
136+
.option('--turbo', 'Starts development mode using Turbopack.')
137+
.option('--turbopack', 'Starts development mode using Turbopack.')
139138
.addOption(
140139
new Option(
141140
'--experimental-build-mode [mode]',
@@ -174,7 +173,6 @@ program
174173
)
175174
.option('--turbo', 'Starts development mode using Turbopack.')
176175
.option('--turbopack', 'Starts development mode using Turbopack.')
177-
.option('--webpack', 'Starts development mode using webpack.')
178176
.addOption(
179177
new Option(
180178
'-p, --port <port>',

0 commit comments

Comments
 (0)