1.0.0 • Published 7 years ago

filename-check-webpack-plugin v1.0.0

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

Install

npm i filename-check-webpack-plugin --save-dev

Usage

unified style

const FilenameCheckPlugin = require('filename-check-webpack-plugin');

module.exports = {
  entry: {
    index: './src/index'
  },
  output: {
    path: './dist',
    filename: '[name].js'
  },
  plugins: [
    new FilenameCheckPlugin({
      path: './src',
      all: 'through'
    })
  ]
};

different style

new FilenameCheckPlugin({
  path: './src',
  dir: 'through',
  file: 'underline'
})

custom style

new FilenameCheckPlugin({
  path: './src',
  all: /$[0-9]*^/
})

Params

path

  • type: String
  • required: required
  • desc: the path of checked directories and files

all

  • type: String | RegExp
  • required: optional
  • desc: unified style

built-in styles:

  • underline lowercase letters and numbers, underline the words, for example company_detail01.html
  • through lowercase letters and numbers,through the words, for example company-detail01.html
  • dot lowercase letters and numbers,dot the words, for example company.detail01.html
  • camelcase camelcase style, for example companyDetail01.html
  • pascal pascal style, for example CompanyDetail01.html

default is underline, support custom style, for example all number style

new FilenameCheckPlugin({
  path: './src',
  all: /$[0-9]*^/
})

print the error message

Alt Text

dir

same as param all

file

same as param all

License

MIT