Skip to content

Commit

Permalink
Rename experimental.resolveAlias to experimental.turbopackResolveAlias (
Browse files Browse the repository at this point in the history
vercel/turborepo#3651)

Following discussion at #45560,
this renames `experimental.resolveAlias` to
`experimental.turbopackResolveAlias` to make it clear that this option
is only available in Turbopack.

Test Plan: `cargo test -p next-dev-tests`
  • Loading branch information
wbinnssmith authored Feb 7, 2023
1 parent 205ce2f commit 0ce9cf5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crates/next-core/src/next_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ pub enum RemotePatternProtocal {
#[serde(rename_all = "camelCase")]
pub struct ExperimentalConfig {
pub app_dir: Option<bool>,
pub resolve_alias: Option<IndexMap<String, JsonValue>>,
pub server_components_external_packages: Option<Vec<String>>,
pub turbopack_loaders: Option<IndexMap<String, WebpackLoaderConfigs>>,
pub turbopack_resolve_alias: Option<IndexMap<String, JsonValue>>,

// unsupported
adjust_font_fallbacks: Option<bool>,
Expand Down Expand Up @@ -414,7 +414,7 @@ impl NextConfigVc {
#[turbo_tasks::function]
pub async fn resolve_alias_options(self) -> Result<ResolveAliasMapVc> {
let this = self.await?;
let Some(resolve_alias) = this.experimental.resolve_alias.as_ref() else {
let Some(resolve_alias) = this.experimental.turbopack_resolve_alias.as_ref() else {
return Ok(ResolveAliasMapVc::cell(ResolveAliasMap::default()));
};
let alias_map: ResolveAliasMap = resolve_alias.try_into()?;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import foo from "foo";
import foo2 from "foo2";

it("aliases foo to bar through the next.config.js experimental.resolveAlias property", () => {
it("aliases foo to bar through the next.config.js experimental.turbopackResolveAlias property", () => {
expect(foo).toBe(42);
});

it("aliases foo2 to bar through the next.config.js experimental.resolveAlias property with export condition", () => {
it("aliases foo2 to bar through the next.config.js experimental.turbopackResolveAlias property with export condition", () => {
expect(foo2).toBe(42);
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
experimental: {
resolveAlias: {
turbopackResolveAlias: {
foo: ["bar"],
foo2: { browser: "bar" },
},
Expand Down

0 comments on commit 0ce9cf5

Please sign in to comment.