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 - npm Package Compare versions

Comparing version 0.0.4 to 0.1.0

dist/index.cjs

8

dist/index.d.ts
import { Plugin } from 'vite';
/**
* 文件输出配置
*/
export interface GenerateFile {
interface GenerateFile {
/**

@@ -28,3 +29,3 @@ * 文件输出位置,相对于输出目录,默认 ./output.txt

}
export declare type Options = GenerateFile | GenerateFile[];
type Options = GenerateFile | GenerateFile[];
/**

@@ -34,2 +35,3 @@ * 插件入口

declare function PluginGenerateFile(options: Options): Plugin;
export default PluginGenerateFile;
export { type GenerateFile, type Options, PluginGenerateFile as default };
{
"name": "vite-plugin-generate-file",
"version": "0.0.4",
"version": "0.1.0",
"license": "MIT",

@@ -22,4 +22,11 @@ "description": "Generate extra file to dist folder.",

},
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",

@@ -29,14 +36,5 @@ "files": [

],
"scripts": {
"build": "rollup -c",
"lint": "run-p lint:*",
"lint:eslint": "eslint \"{src,test}/**/*.ts\"",
"lint:prettier": "prettier \"{src,test}/**/*.ts\" --check",
"fix": "run-s fix:*",
"fix:eslint": "yarn lint:eslint --fix",
"fix:prettier": "yarn lint:prettier --write"
},
"dependencies": {
"chalk": "^4.1.2",
"ejs": "^3.1.6",
"ejs": "^3.1.9",
"js-yaml": "^4.1.0",

@@ -59,10 +57,16 @@ "mime-types": "^2.1.35"

"prettier": "^2.4.1",
"rollup": "^2.56.3",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"tsup": "^5.1.0",
"typescript": "^4.4.3",
"vite": "^2.5.8"
"typescript": "^5.2.2",
"unbuild": "^2.0.0",
"vite": "^4.5.0"
},
"scripts": {
"build": "unbuild",
"lint": "run-p lint:*",
"lint:eslint": "eslint \"{src,test}/**/*.ts\"",
"lint:prettier": "prettier \"{src,test}/**/*.ts\" --check",
"fix": "run-s fix:*",
"fix:eslint": "yarn lint:eslint --fix",
"fix:prettier": "yarn lint:prettier --write"
}
}
}

@@ -14,2 +14,4 @@ # vite-plugin-generate-file

> Since vite-plugin-generate-file@v0.1.0, Vite v3.1 or above is required.
Add plugin to your `vite.config.ts` :

@@ -34,13 +36,14 @@

Available options:
Here are the available options for configuration:
| Name | Description | Options | Defaults |
|---------------|-------------------------------------------------------------------------------------------------------------|---------------------------|----------------|
| `type` | Generate file format type. | `json` `yaml` `template` | `json` |
| `output` | Path to the output file the plugin will generate. It relative to `dist` folder. | - | `./output.txt` |
| `template` | Path to the template file. Support `ejs` format template. Available while `type` is `template`. | - | - |
| `data` | Data to use in generated file or be passed in to the template. | - | - |
| `contentType` | Response Content-Type return from dev server. If empty it will be guessed from the `output` path extension. | - | - |
| Name | Description | Options | Defaults |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------|---------------------------|----------------|
| `type` | Specifies the format type of the generated file. | `json` `yaml` `template` | `json` |
| `output` | Defines the path to the output file that the plugin will generate. This path is relative to the `dist` folder. | - | `./output.txt` |
| `template` | Specifies the path to the template file. Supports `ejs` format template. This option is available when `type` is set to `template`. | - | - |
| `data` | Specifies the data to be used in the generated file or to be passed into the template. | - | - |
| `contentType` | Defines the Content-Type response returned from the dev server. If left empty, it will be inferred from the `output` path extension. | - | - |
In dev mode, plugin will mock file by dev server. See [localhost:3000/__generate_file_list/](http://localhost:3000/__generate_file_list/) for more detail.
In dev mode, plugin will mock file by dev server.
See [localhost:5173/__generate_file_list/](http://localhost:5173/__generate_file_list/) for more detail.

@@ -47,0 +50,0 @@ ## Credits

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