Plurge: Combine Files README
Combine Files with plurge.
Plurge combines files into one output file. You can combine files of type .CSS, .SQL or any other text file in the order you wish.
Additional features include adding a header comment/text for the output file, and include the name of the file as a comment above the content of each file as it is combined into the output file.
Features
- Combine files: n text-based files into one output file.
- Suitable for combinging all text-based files (.css, .sql, .md)
- Generate the plurge template file (used for ordering your files within the output file)
- Add outputfile name and header
- Add header for each included file
Extension Settings
There are no vscode settings. Create a file with *plurge.json format. example: plurge.json, myplurge.json, cssplurge.json. This allows you to create multiple configurations for multiple files to combine.
Config
- A simple JSON object (minimum config)
- Multiple plurge files (cssplurge.json, sqlplurge.json)
- suffix must end in 'plurge.json'
- files, Array of string (path/filename relative from plurge file)
- out, string output filename (relative from plurge file)
- header, a string to prepend to output file. (use \n for newline)
- footer, a string to append to output file. (use \n for newline)
- fileheader, a string to insert ahead of each file when combined
There is only one tag ${filename} and is only used in fileheader
- filename, inserts the filename into the string
Example
{
"files": [
"css/a.css",
"css/b.css",
"css/c.css"
],
"out": "dist/test.css",
"header" : "/*test of css plurging\n\nVersion 1\n*/",
"footer": "/*copyright*/",
"fileheader":"/*${filename}*/"
}
NOTE: Run plurge from command with no arguments to find and run one in your project or to create the default plurge.json on the root of the project.
Run plurge
Plurge is a context menu. Right-click on a *plurge.json file to execute that configuration.
Scenarios
- Combine multiple CSS files into one, then minify.
- Combine multiple SQL files into one to execute.
{
"files": [
"sql/insert.css",
"sql/update.css",
],
"out": "sql.sql",
"header" : "",
"footer": "",
"fileheader":"\n--${filename}\n"
}
- You can have more than one plurge file in your solution.
## Known Issues
None. Let me know if you spot anything.
-----------------------------------------------------------------------------------------------------------
**Enjoy!**