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

replace does not support source maps #570

Open
benignant opened this issue Jan 15, 2023 · 5 comments
Open

replace does not support source maps #570

benignant opened this issue Jan 15, 2023 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@benignant
Copy link

Is your feature request related to a problem? Please describe.
The replace preprocessor does not support source maps. I'm using it to replace multiple lines.

Describe the solution you'd like
Can the replace transformer use the magic-string replace method?

@dummdidumm dummdidumm added enhancement New feature or request good first issue Good for newcomers labels Mar 6, 2023
@Rishab49
Copy link

@dummdidumm @benignant does it means processors/replace.ts should have a method which takes file content, options and returns the new formatted content using magicstring.replace method?

@benignant
Copy link
Author

I think the change would go in transformers/replace.ts.

@Rishab49
Copy link

@benignant But transformer/replace.ts is doing the same thing as magicstring.replace, then why do you want to change it?

@benignant
Copy link
Author

The magic-string replace method maintains the source map.

@Rishab49
Copy link

@benignant Sorry but I can understand your exact requirement.Do you want to use replace method to generate a source map of a given script file using replace method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants