aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
606 stars 52 forks source link

Fix path slash issue in Windows #75

Closed yujinlin0224 closed 1 year ago

yujinlin0224 commented 1 year ago

Fix https://github.com/aklinker1/vite-plugin-web-extension/issues/74

aklinker1 commented 1 year ago

Thanks for the fix! Can we use Vite's normalizePath instead of replacing the slashes manually?

import { normalizePath } from 'vite';

normalizePath(path.relative(paths.rootDir, file))
aklinker1 commented 1 year ago

Hmm, I tried normalizePath out and that doesn't actually work in all cases. I added some unit tests and refactored to using replaceAll