A Metalsmith plugin to concatenate files.
$ npm install metalsmith-concat
{
"plugins": {
"metalsmith-concat": {
"files": "styles/**/*.css",
"output": "styles/app.css"
}
}
}
var MetalSmith = require('metalsmith');
var concat = require('metalsmith-concat');
Metalsmith(__dirname)
.use(concat({
files: 'styles/**/*.css',
output: 'styles/app.css'
}))
.build();
Type: String
/ String[]
Default: '**/*'
This defines which files are concatenated. This string will be interpreted as a minimatch pattern. An array of strings will be interpreted as minimatch patterns, in this case the order of the patterns matters (it will determine the order in which the files are concatenated).
Type: String
It represents the filepath where the concatenated content will be outputted. This option is mandatory.
Type: Boolean
Default: false
Whether to keep the files which were concatenated. By default they are not kept
and deleted from the build (thus only keeping the newly created file at
options.output
).
Type: Boolean
/ String
Default: true
Whether a trailing new line (\n
) should be appended after each concatenated
file. Unless you face a problem, you should keep this option on as removing it
could cause invalid concatenated files (see this
article).
It is also possible to pass a string, in which case it will be used instead of
\n
.
-
3.0.0
-
2.0.0
- Add a newline at the end of each concatenated file by default (#4)
-
1.0.1
- Add the possibility to pass an array of files instead of a matching pattern (#2)
-
1.0.0
- Bump stable
-
0.0.2
- Fix an issue with file content
-
0.0.1
- Working plugin
MIT © Aymeric Beaumet