Skip to content

Commit 9f4a2b1

Browse files
committed
add rollup plugin to delete multiline comments
1 parent e189fcb commit 9f4a2b1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

rollup/plugins/npmPlugins.js

+17
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,23 @@ export function makeRemoveBlankLinesPlugin() {
127127
});
128128
}
129129

130+
/**
131+
* Create a plugin to strip multi-line comments from the output.
132+
*
133+
* @returns A `rollup-plugin-re` instance.
134+
*/
135+
export function makeRemoveMultiLineCommentsPlugin() {
136+
return regexReplace({
137+
patterns: [
138+
{
139+
// The `s` flag makes the dot match newlines
140+
test: /^\/\*.*\*\//gs,
141+
replace: '',
142+
},
143+
],
144+
});
145+
}
146+
130147
/**
131148
* Creates a plugin to replace all instances of "__DEBUG_BUILD__" with a safe statement that
132149
* a) evaluates to `true`

0 commit comments

Comments
 (0)