farm-fe / farm

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

support receive Promise plugin #1224

Open shulandmimi opened 5 months ago

shulandmimi commented 5 months ago

What problem does this feature solve?

// farm.config.ts
const loadAsyncJsPlugin = async () => ({ ... });
const loadAsyncArrJsPlugin = async () => [{ ... }, { ... }]
const loadAsyncRustPlugin async () => '@farmfe/rust-plugin';
const loadAsyncArrRustPlugin async () => [['@farmfe/rust-plugin', options], ...];

export default {
    plugins: [loadAsyncJsPlugin(), loadAsyncArrJsPlugin(), loadAsyncRustPlugin(), loadAsyncArrRustPlugin()]
}

What does the proposed API look like?

modify

combine these two function

DeepeshKalura commented 5 months ago

@shulandmimi I raised the PR tyres to resolve your issue could please look at it and let me know any improvements needed

https://github.com/farm-fe/farm/pull/1255

shulandmimi commented 5 months ago

@DeepeshKalura Thank you very much for your PR, but I see it has not been updated recently, do you have the energy to achieve the rest of it? I can assign this issue to you if you like.

DeepeshKalura commented 5 months ago

@shulandmimi Yeah I would love to work in this issue. The reason I not been updating recently because I was getting a bug while working on this issue Error: Cannot find module '019171a2' while running with pnpm bootstrap. Debugging this issue cause lot's of time.

I got a suggestion to re-clone the project and restart the work from discord farm community. Working on that part.

ErKeLost commented 5 months ago

Has the problem been solved? I didn't reproduce the mistakes you found locally.

DeepeshKalura commented 5 months ago

@ErKeLost Even I can't reproduce later. I just delete the entire code and re-clone it. So, I think problem has been solved for good