The introduction of html-webpack-plugin, nesting into html, cannot be parsed

index.html


</div>

the first layer <% = require ("htmlMurloaderloader.)% > can be introduced normally, while <% = require of systemMainTab/index.html <% = require (" htmlMaiLoader.. heading Paginationindex.html")% > cannot be parsed. Is there any method that can be nested to parse it? is there any way to parse it?

is there any method that can be nested to parse it?

one way is to introduce modules in assembly through js, but it is not well implemented in this way


now that you've used html-loader , you don't actually need to render html through the template of html-webpack-plugin . After configuring html-loader in webpack to enable interpolate, refer to it through the ES6 string template.

webpack:

{
    test: /\.html$/,
    use: [{
        loader: "html-loader",
        options: {
            interpolate: true
        }
    }]
}

html:

<!DOCTYPE html>
<html lang="en">
<head>
    ${require("./common.html")}
</head>

then in common.html, you can continue to use ${require ("xxx.html")} for references. This should be simpler to write than if you use <% =.% > .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf00eb-31cc1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf00eb-31cc1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?