Open peterhodges opened 2 years ago
More info here: https://github.com/isaacs/node-glob/issues/467
Looks like backslashes were never explicitly supported but worked in v7 of node-glob (no longer in v8).
Thanks for reporting and sorry for the delay. I've added your proposed fix with v2.8.1. Would be great if you could check it.
Attempting to use the plugin with Storybook 6.5.9 on Windows and it fails silently by not showing any tokens in the panel or via the doc blocks.
On debugging, it's clear that the
glob.sync
is returning an empty array in plugin.jsgetTokenFilePaths()
.The path is joined onto the context which, on windows, has back slashes:
C:\repos\design-tokens
and ends up asC:\repos\design-tokens\**\*.css
before being passed to glob.sync, which only supports POSIX paths.If I replace backslashes slashes after joining the strings with path.join(), it works fine.
const paths = glob.sync(path.replace(/\\/g, '/'));
It works fine for me using the webpack5 demo from this repo (earlier version of storybook).
From a quick google, it looks like the node-glob package has always worked like this so I'm not sure why it's breaking now.