Skip to content

u12206050/gridsome-plugin-transfer-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gridsome-plugin-transfer-file

Download additional files before building your Gridsome site

Install

  • yarn add gridsome-plugin-transfer-file
  • npm install gridsome-plugin-transfer-file --save

Usage

Add as many files as you want to download in the files array in options.

Existing files WILL BE replaced as it is assumed the latest file is always downloaded.

module.exports = {
  plugins: [
    {
      use: 'gridsome-plugin-transfer-file',
      options: {
        files: [
          {
            url: 'https://server.com/strings.json',
            dest: 'src/strings.json'
          },
          // Make use of env variable
          {
            url: `https://server.com/${process.env.GRIDSOME_LOCALE}.json`,
            dest: 'src/lang.json'
          }
        ]
      }
    }
  ]
}

Options

files

  • Type: array<file>
  • Default null

file

  • Type: object
{
  url: 'https://...',
  dest: 'path',
  // Optional advanced request
  request: {
    method: 'POST' // default GET
    headers: {
      Authentication: 'Bearer 123456'
    }
  }
}

About

Download additional files before building your Gridsome site

Resources

Stars

Watchers

Forks

Packages

No packages published