Skip to content

CodeCoupler Webpack Static Directory

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

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

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

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

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

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

The tags will be placed in the head and body section. If you need to place them in other positions you must 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. Till Version 3 some some of these fileswas be used for special generators (like Favicon and Webmanifest).