Skip to content

Commit d92a18e

Browse files
authored
Revert "Revert "feat(turbopack): support basic next/dynamic" (#56885)"
This reverts commit 8a51ebc.
1 parent 4b3dfda commit d92a18e

File tree

17 files changed

+730
-443
lines changed

17 files changed

+730
-443
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/next-swc/crates/core/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ either = "1"
1515
fxhash = "0.2.1"
1616
hex = "0.4.3"
1717
once_cell = { workspace = true }
18-
next-transform-font = {workspace = true}
1918
pathdiff = "0.2.0"
2019
regex = "1.5"
2120
rustc-hash = "1"
@@ -24,6 +23,9 @@ serde_json = "1"
2423
sha1 = "0.10.1"
2524
tracing = { version = "0.1.37" }
2625

26+
next-transform-dynamic = { workspace = true }
27+
next-transform-font = { workspace = true }
28+
2729
turbopack-binding = { workspace = true, features = [
2830
"__swc_core",
2931
"__swc_core_next_core",

packages/next-swc/crates/core/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use std::{cell::RefCell, path::PathBuf, rc::Rc, sync::Arc};
3737
use auto_cjs::contains_cjs;
3838
use either::Either;
3939
use fxhash::FxHashSet;
40+
use next_transform_dynamic::{next_dynamic, NextDynamicMode};
4041
use next_transform_font::next_font_loaders;
4142
use serde::Deserialize;
4243
use turbopack_binding::swc::{
@@ -58,7 +59,6 @@ mod auto_cjs;
5859
pub mod cjs_optimizer;
5960
pub mod disallow_re_export_all_in_page;
6061
pub mod named_import_transform;
61-
pub mod next_dynamic;
6262
pub mod next_ssg;
6363
pub mod optimize_barrel;
6464
pub mod optimize_server_react;
@@ -226,7 +226,7 @@ where
226226
!opts.disable_next_ssg
227227
),
228228
amp_attributes::amp_attributes(),
229-
next_dynamic::next_dynamic(
229+
next_dynamic(
230230
opts.is_development,
231231
opts.is_server,
232232
match &opts.server_components {
@@ -238,6 +238,7 @@ where
238238
},
239239
_ => false,
240240
},
241+
NextDynamicMode::Webpack,
241242
file.name.clone(),
242243
opts.pages_dir.clone()
243244
),

packages/next-swc/crates/core/src/next_dynamic.rs

Lines changed: 0 additions & 325 deletions
This file was deleted.

0 commit comments

Comments
 (0)