Skip to content

Parcel Using html inclusions with posthtml include

Prez Ivan edited this page Oct 16, 2020 · 1 revision

HTML Inclusions

Parcel allow to include blocks of html in a simply way, as you can see in the following code snippet:

<include src="included_file.html"></include>

Configuration

  • npm install -D posthtml-include
  • create the file posthtml.config.js in the same directory where is located package.json, with the following contents:
module.exports = {
    plugins: {
        'posthtml-include': {
            root: __dirname,
        }
    }
};

Clone this wiki locally