6
Tôi đang tìm cách xóa tất cả nhận xét khỏi tệp javascript bằng gulp.Gulp - xóa nhận xét khỏi tệp javascript
ví dụ, tôi có đoạn mã sau:
/***
* Comment 1 - This is my javascript header
* @desc comment header to be removed
* @params req, res
*/
(function() {
var helloworld = 'Hello World'; // Comment 2 - this is variable
/* Comment 3 - this is the printing */
console.log(helloworld);
})()
Và kết quả mong đợi của tôi là:
(function() {
var helloworld = 'Hello World';
console.log(helloworld);
})();
Bạn có ý nghĩa gì bởi "chỉ bình luận", đầu ra của nó có thể được tạo đường ống để làm mờ/rút gọn? –
Ngớ ngẩn tôi, tôi đã lưu giữ một số tính năng bảo lưu trên cấu hình uglify để lưu một số nhận xét. Cảm ơn –