Giter Site home page Giter Site logo

webpack-filesystem-plugin's Introduction

Webpack filesystem plugin

Filesystem wrapper

Build Status codecov Dependencies dependencies Status devDependencies Status MIT License

Install Instructions

$ npm i webpack-filesystem-plugin

Note: This plugin needs NodeJS >= 6

Usage Instructions

Require webpack-filesystem-plugin

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

Add the plugin to your plugin list

var config = {
  plugins: [
    new WebpackFilesystem({
      action: 'cp',
      source: 'test.txt',
      dist: 'awesome.txt',
    })
  ]
}

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

var config = {
  plugins: [
    new WebpackFilesystem({
      silent: true,
      action: 'cp',
      source: 'test.txt',
      dist: 'awesome.txt',
    })
  ]
}
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:

var config = {
  plugins: [
    new WebpackFilesystem({
      silent: true,
      action: 'cp',
      source: 'test.txt',
      dist: 'awesome.txt',
      logLevel: 'log'
      ...
    })
  ]
}

Contributing

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.