@webdiscus something is wrong with postprocess for js. I think /main.js/ is not here in postprocess moment
new PugPlugin({
postprocess: (content) => {
// ...content
content = content.replace(
/src="(\/.*?\.js)"/g, // doesn't find anything
`src="FROM(my_zip, '$1')"`,
);
return content;
}),
})
src="(\/.*?\.js)" matches src="/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)
@webdiscus something is wrong with
postprocessfor js. I think/main.js/is not here inpostprocessmomentsrc="(\/.*?\.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)