Replies: 3 comments
-
The postprocess will be called after Pug compilation. At this stage the generated HTML contains already hashed assets output filenames, exclude JS. JS files have at this stage resolved absolute path, because inner processing is very complex. |
Beta Was this translation helpful? Give feedback.
-
It works in
If you need to use only absolute path I can change my regex of course |
Beta Was this translation helpful? Give feedback.
-
The the Also, the postprocessing with compiled HTML and original required files is principal impossible. P.S. you has wrong Regexp. return content.replace(/(?<=src=")(.+\.js)(?=")/g, 'REPLACEMENT'); |
Beta Was this translation helpful? Give feedback.
-
@webdiscus something is wrong with
postprocess
for js. I think/main.js/
is not here inpostprocess
momentsrc="(\/.*?\.js)"
matchessrc="/js/main.js"
The links of JS and CSS should be replaced in generated HTML.
Sometimes we need to paste HTML in another parser which reads assets (images, css, js) from zip file and sends to client. So "replacer" replaces to path to zip folder
Originally posted by @silveoj in #36 (comment)
Beta Was this translation helpful? Give feedback.
All reactions