Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename experimental.resolveAlias to experimental.turbopackResolveAlias #3651

Merged
merged 2 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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