Webpack loader to prepend/append text to files
Prepend/append text to the contents loaded by the loader. Useful to add headers, footers or to wrap all your files in the webpack pipeline.
$ npm install --save-dev @shoutem/webpack-prepend-append
Add the loader to your webpack.config.js
:
module.exports = {
// ...
module: {
loaders: [
// ...
{
test: /\.js$/,
loader: '@shoutem/webpack-prepend-append',
query: {
prepend: 'Header text',
append; 'Footer text'
}
}
]
}
}
module.exports = {
// ...
module: {
loaders: [
// ...
{
test: /\.js$/,
loader: '@shoutem/webpack-prepend-append',
query: {
prepend: 'WrapItIntoBlock {',
append; '}'
}
}
]
}
}