farm-fe / farm

Extremely fast Vite-compatible web build tool written in Rust
https://farmfe.org
MIT License
4.94k stars 163 forks source link

preview command adds cross support #1144

Open 289420843 opened 6 months ago

289420843 commented 6 months ago

What problem does this feature solve?

cross-domain access to resource files is supported.

What does the proposed API look like?

farm.config add previewServer config

export default defineConfig({
  server: {
    ...
  },
  previewServer:{
    headers: {
      "Access-Control-Allow-Origin": "*",
    },
    ...
  }
}

or reuse server config.

ErKeLost commented 6 months ago

Thanks, this is a good function point. pr welcome

fu050409 commented 1 month ago

@289420843 Hi, why close this issue?

ErKeLost commented 1 month ago

We have added future plans for previewServer to this issues https://github.com/farm-fe/farm/issues/1589, and we are also accelerating the pace of reconstructing the node side to improve the stability and diversity of farm

289420843 commented 1 month ago

@289420843 Hi, why close this issue?

It's been too long without any progress. If there's a plan, feel free to revive it.

daju233 commented 3 weeks ago

I am a frontend newComer. May I try to add it?I am tring to read the document. What is the good way to start?

ErKeLost commented 3 weeks ago

hi @daju233 Currently, previewServer is being rebuilt. You can contact @fu050409 . he is now responsible for the rebuilt version of previewServer. If you want to contribute or learn other feature, you can take a look at this roadmap https://github.com/farm-fe/farm/issues/1589 contributions are welcome