Skip to content

How to support define options. #186

@underfin

Description

@underfin

Because the vite use esbuild define option at optimizer, the rollup has [@rollup/plugin-replace](https://github.com/rollup/plugins/tree/master/packages/replace#rollupplugin-replace) to do it, it using string match to replace, it is performance friendly but other ecosystem using last to do it, eg swc/webpack.

I think we can use @rollup/plugin-replace to do it at milestone 1. It means we need to support some plugin API for the plugin, it is easy to implement.
But we need re-think it how to support it at rolldown for better performance and correct replace result.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions