Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rolldown should supporting plugin order and have a fully investigation on it. #770

Open
moushicheng opened this issue Apr 6, 2024 · 0 comments

Comments

@moushicheng
Copy link

moushicheng commented Apr 6, 2024

what is plugin order?

rollup doc

order: "pre" | "post" | null
If there are several plugins implementing this hook, either run this plugin first ("pre"), last ("post"), or in the user-specified > position (no value or null).

export default function resolveFirst() {
	return {
		name: 'resolve-first',
		resolveId: {
			order: 'pre',
			handler(source) {
				if (source === 'external') {
					return { id: source, external: true };
				}
				return null;
			}
		}
	};
}

If several plugins use "pre" or "post", Rollup runs them in the user-specified order. This option can be used for all plugin hooks. For parallel hooks, it changes the order in which the synchronous part of the hook is run.

current situation

rolldown cant support order, And we still need to discuss some implementation details to avoid rollup's technical debt.

for Example:

  1. On which end(js or rs) should this feature be implemented ?
  2. ...
  3. ...

I am currently investigating rollup's plugin feature

if you be familiar with rollup plugin or you have any ideas, welcome discussion here

@moushicheng moushicheng changed the title rolldown should supporting plugin order and have a fully investigation on it. Rolldown should supporting plugin order and have a fully investigation on it. Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant