-
-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Clear and concise description of the problem
The function commit update the MagicString to the new one.
I wonder If it is possible that you can commit with name, and rollback the named stage to use the relative position of any committed one?
Suggested solution
Like this:
const s = new MagicStringStack('problems = 99') //now we named it `origin`
s.replace('problems', 'issues')
.append('var ')
s.toString()
s.original
s.commit("Middle") // now we named the staged `Middle`
s.original
s.replace('issues', 'problems')
s.toString()
//many named stage
s.rollback('Middle') //now we go back to 'Middle' stage
s.rollback('origin') //now we go back the origin one
//...
s.generateMap()
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request