Do not delete "fake" source map comments from strings (#9960)
Instead of using `convert-source-map`'s `removeComments` method before parsing the file, we can first parse the file with `@babel/parser` and then analyze the comments. This is needed because it is not possible to reliabily detect comments in JavaScript without fully parsing the file: https://github.com/thlorenz/convert-source-map/issues/63
This commit is contained in:
@@ -7,7 +7,7 @@ import { VISITOR_KEYS } from "../definitions";
|
||||
*/
|
||||
export default function traverseFast(
|
||||
node: Object,
|
||||
enter: (node: Node, opts?: Object) => void,
|
||||
enter: (node: BabelNode, opts?: Object) => void,
|
||||
opts?: Object,
|
||||
): void {
|
||||
if (!node) return;
|
||||
|
||||
Reference in New Issue
Block a user