HorusGoul / vite-plugin-stylex

Vite Plugin for StyleX
MIT License
111 stars 11 forks source link

Wrong path in index.html on Windows #15

Closed Yzen90 closed 7 months ago

Yzen90 commented 7 months ago

The css file gets inserted in the index.html with a wrong path on Windows with vite build:

<link rel="stylesheet" href="\\assets\\stylex.b14ace87.css">

Changing this line in the plugin:

const publicPath = path.join(publicBasePath, fileName);

To

const publicPath = path.posix.join(publicBasePath, fileName.replace('\\', '/'));

Inserts a correct path in the index.html:

<link rel="stylesheet" href="/assets/stylex.b14ace87.css">
HorusGoul commented 7 months ago

Thanks for the report; this should be fixed in v0.3.1!

Let me know if it works for you :smile: