0.0.2 • Published 2 years ago

vite-plugin-structure-graph v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vite-plugin-structure-graph

npm

A vite plugin to generate project structure graph

Table of Contents

  1. Installation
  2. Usage
  3. Issues
  4. License

Installation

  npm i --save-dev vite-plugin-structure-graph
  yarn add --dev vite-plugin-structure-graph

Usage

Here's an example vite config illustrating how to use this plugin

vite.config.js

import structureGraphPlugin from 'vite-plugin-structure-graph';
{
  ...
  plugins: [structureGraphPlugin()]
}

You can pass a hash of configuration options to vite-plugin-structure-graph. Allowed values are as follows:

NameTypeDefaultDescription
targetName{String}structure.txtThe target file name of the generated directory structure map
ignoreDirectorys{Array.<string>}|List of directories ignored in the process of generating files
ignoreFiles{Array.<string>}|List of files ignored in the process of generating files
dress{String}dashedThe generated directory structure style, there are two values, dashed and solid

Here's an example vite config illustrating how to use these options

vite.config.js

import structureGraphPlugin from 'vite-plugin-structure-graph';
{
  ...
  plugins: [
    structureGraphPlugin({
      targetName: 'structure.md',
      ignoreDirectorys: ['.git', 'node_modules'],
      ignoreFiles: ['.DS_Store', 'structure.md']
    })
  ]
}

The generated project structure graph:

+-- dream-wall
¦    +-- .gitignore
¦    +-- README.md
¦    +-- favicon.ico
¦    +-- index.html
¦    +-- package-lock.json
¦    +-- package.json
¦    +-- src
¦        +-- App.vue
¦        +-- components
¦            +-- footer.vue
¦            +-- header.vue
¦            +-- loading.vue
¦        +-- http
¦            +-- index.js
¦        +-- main.js
¦        +-- pages
¦            +-- download.vue
¦            +-- dream.vue
¦            +-- signin.vue
¦            +-- signup.vue
¦        +-- router
¦            +-- index.js
¦    +-- yarn.lock

Issues

If you encounter some problems during use, please click here Issue Report

License

MIT

Copyright (c) 2022-present flyfox