Webpack loader to append text to files
Append a header to the contents loaded by the loader. Useful to add headers to all your files in the webpack pipeline.
Motivation: I wanted to use Ramda functions directly in my application without import every single one causing a huge bloat in my import statements. I also didn't want to keep using the "R." prefix.
Install:
$ npm install --save-dev webpack-append
Usage:
Add the loader to your webpack.config.js
:
moduleexports = // ... module: loaders: // ... test: /\.js$/ loader: 'webpack-append' query: 'console.log(\'This header sits perfectly at the begining of my file.!\')'
My use case:
const importAllRamdaFunctions = 'import { ' + Object + ' } from \'ramda\'' moduleexports = // ... module: loaders: // ... test: /\.js$/ loader: 'webpack-append' query: importAllRamdaFunctions
Contributing:
Feel free to open issues to propose stuff and participate. Pull requests are also welcome.