laravel-mix-filesystem-deployment
Deploy compiled assets to the filesystem
Last updated 6 months ago by elishawitte .
MIT · Original npm · Tarball · package.json
$ cnpm install laravel-mix-filesystem-deployment 
SYNC missed versions from official npm registry.

Laravel Mix Filesystem Deployment

Laravel Mix plugin for copying compiled asset files to one or multiple deployment paths on the filesystem.

installation   ·   usage   ·   options   ·   example


Installation

npm install laravel-mix-filesystem-deployment

Usage

mix.then(async stats => {
  const deploy = require('laravel-mix-filesystem-deployment');
  await deploy({
    deployPaths: ['/home/user/mounts/dev/acme'],
  });
});

Options

Configure the plugin by passing an options object as the first argument.

Option Default Details
stats undefined Webpack stats containing information for all compiled assets. When the stats object is passed, only compiled assets will be copied. If no stats are passed, all files in the publicPath folder matching the files pattern are copied.
publicPath dist Public path where the compiled assets (and the mix-manifest.json) are located.
files ['**/*'] Whitelist of files that should be copied.
clear true Should the deployPath directory be cleared before copying files?
manifest mix-manifest.json inside the publicPath folder. Contents of your mix-manifest.json file.
deployPaths [] REQUIRED. List of paths where the assets should be copied to.

Example

The following example copies only the compiled assets during the current webpack incremental build for development mode, but clears the directory and copies all files for production mode.

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

const config = {
  srcPath: 'src',
  distPath: 'dist',
  deployPaths: ['/home/user/mounts/dev/acme'],
};

const source = {
  images: path.resolve(config.srcPath, 'images'),
  scripts: path.resolve(config.srcPath, 'js'),
  styles: path.resolve(config.srcPath, 'css'),
  templates: path.resolve(config.srcPath, 'templates'),
};

mix.then(async stats => {
  const deploy = require('laravel-mix-filesystem-deployment');
  await deploy({
    clear: Mix.inProduction(),
    stats: Mix.inProduction() ? undefined : stats,
    deployPaths: config.deployPaths,
  });
});

Current Tags

  • 1.0.0                                ...           latest (6 months ago)

1 Versions

  • 1.0.0                                ...           6 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |