JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2578
  • Score
    100M100P100Q135740F
  • License MIT

Laravel Mix extension to provide copy method that watches for changes, additions and deletions

Package Exports

  • laravel-mix-copy-watched

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (laravel-mix-copy-watched) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Laravel Mix Copy Watched

This extension provides a copy method that can watch for not only changes but also additions and deletions.

Usage

First, install the extension.

npm install laravel-mix-copy-watched --save-dev

Then, require it within your webpack.mix.js file, like so:

let mix = require('laravel-mix');

require('laravel-mix-copy-watched');

mix
    .js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .copyWatched('resources/images/app.png', 'public/images');

And you're done!

The copyWatched and copyDirectoryWatched methods has the same usage as the copy and copyDirectory methods.

mix.copyWatched(from, to);
mix.copyWatched('from/regex/**/*.txt', to);
mix.copyWatched([path1, path2], to);
mix.copyDirectoryWatched(fromDir, toDir);

With the base option, it is also possible to keep a hierarchical structure (like Gulp).

mix.copyWatched(
    'resources/images/**/*',
    'public/images',
    { base: 'resources/images' }
);