Skip to content

CodeCoupler Webpack Static Directory

Files within the folder static will be copied to the build result in the dist folder. This is the best place to write your demo or test pages, or to add other static assets 1.

The subfolder inc will be ignored and not copied by default. You can control this behaviour using the staticparser.keepIncSource (see Configuration Reference).

Note: The perfomance hints of webpack will be disabled for all files copied from the static folder.

Note: In the static folder, you will find a file named index.html. If you delete this file and no other HTML file remains, a default index.html file will be created in your dist folder.

The HTML files in this directory will be parsed, and links to your bundled JavaScript files, bundled Stylesheet files, externalized libraries and the links to the generated favicons will be injected as script and link tags. The resulting HTML will also be minified.

Which HTML files will be parsed is defined in staticParser.htmlTemplates (see Configuration Reference). By default, all *.html files, except those inside the folder inc, will be parsed.

The tags will be placed in the head and body sections. To place them in other positions, disable the inject feature in the staticParser.htmlInject (see Configuration Reference) and use the following placeholders:

<%- htmlWebpackPlugin.tags.headTags %>
<%- htmlWebpackPlugin.tags.bodyTags %>

You can include parts from other files with:

<%- include inc/part.html %>

  1. Until version 3, some of these files were used for special generators, like Favicon and Webmanifest. ↩