This plugin is my version of include-replace-webpack-plugin ( https://github.com/justkidding96/include-replace-webpack-plugin )
Repository url: ( https://github.com/krzys1u/include-file-webpack-plugin )
Use @@include('path_to_file')
to place here content of file.
const IncludeFileWebpackPlugin = require('include-file-webpack-plugin');
plugins: [
new IncludeFileWebpackPlugin(config)
]
const config = {
directory: './public/', //path to directory with files
input: 'input.html',
output: 'output.html',
processIncludeContents: function(html) {
return html;
}
}
this config checks /public/input.html
to find @@include
tags and replace it with content
of their files, next save results in /public/output.html
,
all pathes to including files will be read from path /public/
Include and replace is open-sourced software licensed under the MIT license.