Skip to content

Commit

Permalink
turbopack-node: Use path.join for postcss loader
Browse files Browse the repository at this point in the history
Follow-up suggested in #7995 (comment)
  • Loading branch information
bgw committed May 7, 2024
1 parent dd837ad commit 57221fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/turbopack-node/src/transforms/postcss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,10 @@ pub(crate) async fn config_loader_source(
// Bundling would break the ability to use `require.resolve` in the config file.
let code = formatdoc! {
r#"
import {{ pathToFileURL }} from 'url';
import {{ pathToFileURL }} from 'node:url';
import path from 'node:path';
const configPath = `${{process.cwd()}}/${{{config_path}}}`;
const configPath = path.join(process.cwd(), {config_path});
// Absolute paths don't work with ESM imports on Windows:
// https://github.com/nodejs/node/issues/31710
// convert it to a file:// URL, which works on all platforms
Expand Down

0 comments on commit 57221fb

Please sign in to comment.