esi-webpack-plugin
A Webpack plugin to resolve ESI includes.
Useful in development in conjunction with html-webpack-plugin to resolve ESI includes (using nodesi) in all emitted HTML files.
Install
npm install --save-dev esi-webpack-plugin
Usage
Options map more or less directly to the options provided by nodesi:const HtmlWebpackPlugin = require('html-webpack-plugin')
const EsiWebpackPlugin = require('esi-webpack-plugin')
module.exports = {
// ...
plugins: [
new HtmlWebpackPlugin(),
new EsiWebpackPlugin({
baseUrl: 'http://example.com',
onError(src, err) {
console.error(`Error when resolving ${src}: ${err}`)
},
processOptions: {
headers: {
Authorization: 'Basic Zm9vOmJhcgo=',
},
},
}),
],
}