项目作者: iGitScor

项目描述 :
Filesystem wrapper
高级语言: JavaScript
项目地址: git://github.com/iGitScor/webpack-filesystem-plugin.git
创建时间: 2017-01-26T10:33:47Z
项目社区:https://github.com/iGitScor/webpack-filesystem-plugin

开源协议:MIT License

下载


Webpack filesystem plugin

Filesystem wrapper

Build Status
codecov
Dependencies
dependencies Status
devDependencies Status
MIT License

Install Instructions

  1. $ npm i webpack-filesystem-plugin

Note: This plugin needs NodeJS >= 6

Usage Instructions

Require webpack-filesystem-plugin

  1. var WebpackFilesystem = require('webpack-filesystem-plugin')

Add the plugin to your plugin list

  1. var config = {
  2. plugins: [
  3. new WebpackFilesystem({
  4. action: 'cp',
  5. source: 'test.txt',
  6. dist: 'awesome.txt',
  7. })
  8. ]
  9. }

Options

Actions

  • cp: Copy files or directories
  • rm: Remove files or directories

Common options

  • silent (bool): Display/hide info logs
  • buildTrigger (string): Webpack build step (c.f plugin documentation). See below accepted steps:
    • after-emit
    • done
    • failed

Use silent mode

  1. var config = {
  2. plugins: [
  3. new WebpackFilesystem({
  4. silent: true,
  5. action: 'cp',
  6. source: 'test.txt',
  7. dist: 'awesome.txt',
  8. })
  9. ]
  10. }
logLevel
  • Type: String
  • Default: strict
  • Allowed value: strict, log, none
    • strict: catch errors in an exception, the webpack build crashes
    • log: log errors in a log file (warning.log) and none behavior
    • none: show errors in console (when silent mode is off)

Specify behavior when the plugin fail.

Example:

  1. var config = {
  2. plugins: [
  3. new WebpackFilesystem({
  4. silent: true,
  5. action: 'cp',
  6. source: 'test.txt',
  7. dist: 'awesome.txt',
  8. logLevel: 'log'
  9. ...
  10. })
  11. ]
  12. }

Contributing

All contributions are welcome. Please make a pull request and make sure things still pass after running npm test