Ask for help on using webpack in jsp or freemarker projects

traditional multi-page projects use html-webpack-plugin to load jsp or ftl files, because there is a special syntax inside, so directly using html-webpack-plugin will fail to package, and then use raw-loader on the basis of html-webpack-plugin to package ok.

but there is a problem. html-webpack-plugin uses ejs syntax by default, so that < div class= "banner" style= "background-image: url (${require (".. /.. / assets/images/common/banner_4.png")})" > < / div > can be used in html, but html-webpack-plugin loses this ability after adding raw-loader . The problem with

now is that I can"t strike a balance between ${require ()} and raw-loader . Do you have an old driver?

clipboard.png

Jul.14,2022

has been solved. I have extended raw-loader to have the ability to deal with pictures


Why not change the way of thinking: if build's good js is introduced into the template file, the template file should be handed over to Java to deal with

.
Menu