Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-generate-file

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-generate-file

Generate extra file to dist folder.

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vite-plugin-generate-file

vite-plugin-generate-file is a vite plugin which generate static file and write them to dist folder after packaging.

Usage

Install dev dependency :

yarn add vite-plugin-generate-file -D
npm install vite-plugin-generate-file -D

Add plugin to your vite.config.ts :

// vite.config.ts
import generateFile from 'vite-plugin-generate-file'

export default {
  plugins: [
    generateFile([{
      type: 'json',
      output: './output.txt',
      data: {
        foo: 'bar'
      }
    }])
  ]
}

Available options:

NameDescriptionOptionsDefaults
typeGenerate file format type.json yaml templatejson
outputPath to the output file the plugin will generate. It relative to dist folder.-./output.txt
templatePath to the template file. Support ejs format template. Available while type is template.--
dataData to use in generated file or be passed in to the template.--

In dev mode, plugin will mock file by dev server. See localhost:3000/__generate_file_list/ for more detail.

Credits

This plugin was inspired by Alicevia/vite-plugin-generate-config-into-dist and antfu/vite-plugin-inspect

License

MIT

Keywords

FAQs

Package last updated on 01 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc