Skip to content

Commit

Permalink
nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jan 12, 2023
1 parent 3249c77 commit 824f34b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
5 changes: 1 addition & 4 deletions crates/next-core/src/next_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,7 @@ impl NextConfigVc {
#[turbo_tasks::function]
pub async fn webpack_loaders_options(self) -> Result<WebpackLoadersOptionsVc> {
let this = self.await?;
let Some(experimental) = this.experimental.as_ref() else {
return Ok(WebpackLoadersOptionsVc::cell(WebpackLoadersOptions::default()));
};
let Some(turbopack_webpack_loaders) = experimental.turbopack_webpack_loaders.as_ref() else {
let Some(turbopack_webpack_loaders) = this.experimental.as_ref().and_then(|experimental| experimental.turbopack_webpack_loaders.as_ref()) else {
return Ok(WebpackLoadersOptionsVc::cell(WebpackLoadersOptions::default()));
};
let mut extension_to_loaders = IndexMap::new();
Expand Down
5 changes: 2 additions & 3 deletions crates/turbopack-node/js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"checkJs": false,

// environment
"jsx": "react-jsx",
"lib": ["ESNext", "DOM"],
"lib": ["ESNext"],
"target": "esnext",

// modules
Expand All @@ -27,5 +26,5 @@
"noEmit": true,
"stripInternal": true
},
"include": ["src", "types"]
"include": ["src"]
}
10 changes: 5 additions & 5 deletions crates/turbopack-node/src/transforms/webpack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl WebpackLoadersVc {
impl SourceTransform for WebpackLoaders {
#[turbo_tasks::function]
fn transform(&self, source: AssetVc) -> AssetVc {
WebpackLoadersedAsset {
WebpackLoadersProcessedAsset {
evaluate_context: self.evaluate_context,
execution_context: self.execution_context,
loaders: self.loaders,
Expand All @@ -73,22 +73,22 @@ impl SourceTransform for WebpackLoaders {
}

#[turbo_tasks::value]
struct WebpackLoadersedAsset {
struct WebpackLoadersProcessedAsset {
evaluate_context: AssetContextVc,
execution_context: ExecutionContextVc,
loaders: StringsVc,
source: AssetVc,
}

#[turbo_tasks::value_impl]
impl Asset for WebpackLoadersedAsset {
impl Asset for WebpackLoadersProcessedAsset {
#[turbo_tasks::function]
fn path(&self) -> FileSystemPathVc {
self.source.path()
}

#[turbo_tasks::function]
async fn content(self_vc: WebpackLoadersedAssetVc) -> Result<AssetContentVc> {
async fn content(self_vc: WebpackLoadersProcessedAssetVc) -> Result<AssetContentVc> {
Ok(self_vc.process().await?.content)
}
}
Expand Down Expand Up @@ -116,7 +116,7 @@ fn webpack_loaders_executor(project_root: FileSystemPathVc, context: AssetContex
}

#[turbo_tasks::value_impl]
impl WebpackLoadersedAssetVc {
impl WebpackLoadersProcessedAssetVc {
#[turbo_tasks::function]
async fn process(self) -> Result<ProcessWebpackLoadersResultVc> {
let this = self.await?;
Expand Down

0 comments on commit 824f34b

Please sign in to comment.