Skip to content
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
8 changes: 4 additions & 4 deletions crates/pack-core/src/client/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,10 @@ pub async fn get_client_resolve_options_context(

let custom_conditions = vec![mode.await?.condition().into()];
let resolve_options_context = ResolveOptionsContext {
enable_typescript: true,
enable_react: true,
enable_mjs_extension: true,
custom_extensions: config.resolve_extension().owned().await?,
enable_node_modules: Some(project_path.root().owned().await?),
custom_conditions,
import_map: Some(client_import_map),
Expand All @@ -457,10 +461,6 @@ pub async fn get_client_resolve_options_context(
..Default::default()
};
Ok(ResolveOptionsContext {
enable_typescript: true,
enable_react: true,
enable_mjs_extension: true,
custom_extensions: config.resolve_extension().owned().await?,
rules: vec![(
foreign_code_context_condition(config).await?,
resolve_options_context.clone().resolved_cell(),
Expand Down
21 changes: 8 additions & 13 deletions crates/pack-tests/tests/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,14 @@ async fn run(resource: PathBuf) -> Result<()> {
},
noop_backing_storage(),
));
match tt
.run(async move {
let emit_op = run_inner_options(resource.to_str().unwrap().into());
emit_op.read_strongly_consistent().await?;
apply_effects(emit_op).await?;

Ok(())
})
.await
{
Ok(()) => {}
Err(e) => return Err(e.into()),
}
tt.run_once(async move {
let emit_op = run_inner_options(resource.to_str().unwrap().into());
emit_op.read_strongly_consistent().await?;
apply_effects(emit_op).await?;

Ok(())
})
.await?;

Ok(())
}
Expand Down
3 changes: 2 additions & 1 deletion crates/pack-tests/tests/snapshot/basic/alias/input/a.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export const foo = "foo";
export const bar = "bar";
export const bar = "bar";
export const a = "a from alias test";
5 changes: 5 additions & 0 deletions crates/pack-tests/tests/snapshot/basic/alias/input/b.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { aliasA as aliasB } from "alias-pkg";

console.log(aliasB);

export { aliasB }
6 changes: 4 additions & 2 deletions crates/pack-tests/tests/snapshot/basic/alias/input/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { foo } from 'hello-a';
import { aliasPkg } from "alias-pkg";
import { aliasPkg, aliasA } from "alias-pkg";
import { bar } from '@@/a';
import { aliasB } from '@@/b';

console.log(foo, aliasPkg, bar);

console.log('xxxx');
console.log('a from alias-pkg', aliasA);
console.log('b from alias-pkg', aliasB);

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push([
typeof document === "object" ? document.currentScript : undefined,
{"otherChunks":["crates_pack-tests_tests_snapshot_450cdc63.js"],"runtimeModuleIds":[70]}
{"otherChunks":["crates_pack-tests_tests_snapshot_d4ef97b5.js"],"runtimeModuleIds":[70]}
]);
// Dummy runtime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading