Open andrewcartwright1 opened 3 months ago
The current implementation of the SwcJsMinimizerRspackPlugin format.comments (https://rspack.dev/plugins/rspack/swc-js-minimizer-rspack-plugin) does not allow regex to be used like https://webpack.js.org/plugins/terser-webpack-plugin/#preserve-comments
format.comments
new TerserPlugin({ terserOptions: { format: { comments: /@.* [\w|\d].*|==\/?UserScript==/i } } })
it instead requires either comments?: false | 'some' | 'all';, would like to propose supporting a regex so that certain comments will be left untouched when using SwcJsMinimizerRspackPlugin as a minimizer
comments?: false | 'some' | 'all';
This feature can be sent to swc repository as well
What subject does this issue tracking?
The current implementation of the SwcJsMinimizerRspackPlugin
format.comments
(https://rspack.dev/plugins/rspack/swc-js-minimizer-rspack-plugin) does not allow regex to be used like https://webpack.js.org/plugins/terser-webpack-plugin/#preserve-commentsit instead requires either
comments?: false | 'some' | 'all';
, would like to propose supporting a regex so that certain comments will be left untouched when using SwcJsMinimizerRspackPlugin as a minimizer