A plugin for your Gridsome project that lets you copy the files from the dist directory to another directory of your choosing after running a build.
While updating by blog powered by Gridsome, I found myself constantly having to copy over the files from the build folder over to another folder that contained by site.github.io project. To solve this problem, I created this plugin so that the files would automatically get copied over after running a build.
To install this plugin, use:
$ npm install gridsome-plugin-copy-build
To use this plugin in your Gridsome project, simply go to your gridsome.config.js
file and under the plugins section add:
plugins: [
{
use: 'gridsome-plugin-copy-build',
options: {
targetDir: path.resolve(__dirname, '/path/to/copy/target'),
verbose: true
}
}
]
param | type | description | default |
---|---|---|---|
options | Object | ||
options.targetDir | string | The directory to copy the build files to. | |
options.verbose | boolean | Indicates whether info logs should be output to the console or not. | false |
To run the tests for this plugin, use:
$ npm run test
MIT