I am using Pug for a web page that I am building.
At the end of a module I have a script. tag (the regular script tag cannot be used because it isn't compatible with jQuery):
script.
// load more videos
$("#btn-more").click(() => {
$.get(`#{lang}/videos?quantity=#{numVideos + 2}`)
.done((videos) => {
$(videos).ready(() => {
$("#videos").replaceWith(videos)
})
})
})
Which ends up producing code that is not minified:
<script>// load more videos
$("#btn-more").click(() => {
$.get(`en/videos?quantity=6`)
.done((videos) => {
$(videos).ready(() => {
$("#videos").replaceWith(videos)
})
})
})</script>
Is there a way to have Pug minify the code? I have not figured out how to use filters (Uglify JS) on the script. tag.
Script: uglify-js
// load more videos
$("#btn-more").click(() => {
$.get(`#{lang}/videos?quantity=#{numVideos + 2}`)
.done((videos) => {
$(videos).ready(() => {
$("#videos").replaceWith(videos)
})
})
})