Vite build not including css file with ?inline tag

I have this project (Project A), which has npm installed another package of mine (Project B). this package (Project B) has multiple inline CSS files which it imports as “import abc from “../../file.css?inline”

This works for this package(Project B) as standalone, and when I build my vite project(Project A) which has it (Project B) installed in it’s node_modules while it’s symlinked (npm link) it also imports it as a string in the resulting .js file it builds. However, when I install Project B as a regular NPM package, it doesn’t import the ?inline file into the resulting .js file.

Project B has the following code in it’s rollup config to make it work for it standalone:

function cssInline() {
  return {
    name: 'css-inline',
    resolveId(source) {
      if (source.endsWith('?inline')) {
        console.log('css-inline plugin resolveId:', source);
        return source;
      }
      return null;
    },
    load(id) {
      if (id.endsWith('?inline')) {
        const filePath = id.replace('?inline', '');
        const absolutePath = path.isAbsolute(filePath)
          ? filePath
          : path.resolve(process.cwd(), filePath);

        console.log('css-inline plugin load:', absolutePath);

        try {
          const css = fs.readFileSync(absolutePath, 'utf-8');
          console.log('css-inline plugin css content length:', css.length);
          return `export default ${JSON.stringify(css)}`;
        } catch (err) {
          console.error(`Error reading CSS file ${absolutePath}:`, err);
          return `export default 'test'`;
        }
      }
      return null;
    },
  };
}