nguyenbatranvan / vite-multiple-assets

npm package
https://www.npmjs.com/package/vite-multiple-assets
8 stars 7 forks source link

Request static file with query return 404 #11

Closed ZXZhuang closed 6 months ago

ZXZhuang commented 7 months ago

Environment: Windows 11; Vite 4.5.1;

Request static file with query return 404

const f = 'iconfont.woff2'
const file = 'iconfont.woff2?t=1702609282724'
path.relative(f, file) // => "..\\iconfont.woff2?t=1702609282724"
path.relative(f, file) === "" // false
nguyenbatranvan commented 7 months ago

Environment: Windows 11; Vite 4.5.1;

Request static file with query return 404

const f = 'iconfont.woff2'
const file = 'iconfont.woff2?t=1702609282724'
path.relative(f, file) // => "..\\iconfont.woff2?t=1702609282724"
path.relative(f, file) === "" // false

Maybe windows has a different path than macos =))

ZXZhuang commented 7 months ago

image image viteServePublicMiddleware clean request url to get correct file url

nguyenbatranvan commented 7 months ago

image image viteServePublicMiddleware clean request url to get correct file url

Hello! This is the solution you want to suggest me?

ZXZhuang commented 7 months ago

Yes.

nguyenbatranvan commented 7 months ago

Yes.

Tks so much!! You can be a contributor if you want!!! By forking the project & creating a pull request for this issue

nguyenbatranvan commented 7 months ago

I'm thinking of adding play-wright to it to run tests on operating systems =))) !!

nguyenbatranvan commented 6 months ago

I have released version 1.2.10 about this issue, you can check and close it