Skip to content

Commit

Permalink
Fix relay
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jul 5, 2024
1 parent db3383e commit 5e71320
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/turbopack-ecmascript-plugins/src/transform/relay.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::path::PathBuf;
use std::{path::PathBuf, sync::Arc};

use anyhow::{Context, Result};
use async_trait::async_trait;
Expand Down Expand Up @@ -33,7 +33,7 @@ pub enum RelayLanguage {

#[derive(Debug)]
pub struct RelayTransformer {
config: swc_relay::Config,
config: Arc<swc_relay::Config>,
project_path: FileSystemPath,
}

Expand All @@ -53,7 +53,7 @@ impl RelayTransformer {
};

Self {
config: options,
config: options.into(),
project_path: project_path.clone(),
}
}
Expand All @@ -75,7 +75,7 @@ impl CustomTransformer for RelayTransformer {

let p = std::mem::replace(program, Program::Module(Module::dummy()));
*program = p.fold_with(&mut swc_relay::relay(
&self.config,
self.config.clone(),
FileName::Real(PathBuf::from(ctx.file_name_str)),
path_to_proj,
// [TODO]: pages_dir comes through next-swc-loader
Expand Down

0 comments on commit 5e71320

Please sign in to comment.