Skip to content

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Sep 25, 2025

Fixes #18418

Pulled some old code that oxc-resolver used. They did switch to fs::read_link at some point though. Perhaps we should do the same here?

  • Needs tests
  • Investigate read_link

@thecrypticace
Copy link
Contributor Author

thecrypticace commented Sep 25, 2025

Notes for me:

Requires a linux container to test:

container run -it -v $(pwd)/temp:/temp --entrypoint /bin/bash node

Test file:

// Local compiled versions
let native = require("./native/package/tailwindcss-oxide.linux-arm64-gnu.node");
let wasi = require("./wasi/package/tailwindcss-oxide.wasi.cjs");

// Installed versions
// let native = require("@tailwindcss/oxide");
// let wasi = require("@tailwindcss/oxide-wasm32-wasi");

let fs = require("node:fs");

fs.mkdirSync("node_modules/example", { recursive: true });
fs.writeFileSync("node_modules/example/test.mjs", "bg-red-500");

let sources = [{ base: process.cwd(), pattern: "node_modules/example/test.mjs", negated: false }];

let expected = {
  native: ["bg-red-500"],
  wasi: ["bg-red-500"],
};

let actual = {
  native: new native.Scanner({ sources }).scan(),
  wasi: new wasi.Scanner({ sources }).scan(),
};

console.log({ expected, actual });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@source directive not working in Stackblitz when targeting node_modules
1 participant