Akryum / meteor-vite

MIT License
34 stars 19 forks source link

Failed to import css with url() reference #31

Open zhongqf opened 1 year ago

zhongqf commented 1 year ago

Hi, @Akryum, vite-bundler is a great package to connect meteor with vite. All is going fine, but vite-bundler failed to import css with url() reference.

I'm using the latest meteor 2.10, which is using vite:bundler package as the default solution for vue project. So just run meteor create --vue3 example to generate a scarffold and add:

//  import/ui/main.js
import "sample.css"

// import/ui/sample.css
@font-face {
  font-family: "remixicon",
  src: url("remixicon.woff2") format("woff2") 
}

// import/ui/remixicon.woff2 does exists.

It seems that remixicon.woff2 file in css url is pointed to default localhost:3000/.... not localhost:5173/... which is vite served.

In a standalone vite project, it is rebased to localhost:5173/.... correctly.