Skip to content

wongchichong/filelist-webpack-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#filelist Plugin Generate all files as json file in folder.

##Install

npm install --save-dev filelist-webpack-plugin

##Usage

const filelistWebpackPlugin = require('filelist-webpack-plugin');

module.exports = {
  
  plugins: [
    new filelistWebpackPlugin({
        filePath: '../folderName',
        exportPath: '../exportPath/folderName/filelist.json'
    }),
  ]
}

##Output filelist.json

[
    {
        "2017-01-01": [
            "2017-01-01.md"
        ]
    },
    {
        "2017-01-02": [
            "2017-01-02.md"
        ]
    },
    {
        "2017-01-03": [
            "2017-01-03.md"
        ]
    }
]

##Usage

const filelistWebpackPlugin = require('filelist-webpack-plugin');

module.exports = {

  plugins: [
    new filelistWebpackPlugin({
        format: 'array',
        //include others
        concat: [".", "./", "./scripts/app.js"],
        //files to exclude regex
        exclude: /filelist|robots/,        
        filePath: '../folderName',
        exportPath: '../exportPath/folderName/filelist.json'
    }),
  ]
}

##Output filelist.json

[
  "./2017-01-01/2017-01-01.md",
  "./2017-01-02/2017-01-02.md",
  "./2017-01-03/2017-01-03.md",
]

About

filelist-webpack-plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%