Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chiiya/laravel-mix-filesystem-deployment
Laravel Mix plugin for copying compiled asset files to one or multiple deployment paths on the filesystem.
https://github.com/chiiya/laravel-mix-filesystem-deployment
Last synced: 12 days ago
JSON representation
Laravel Mix plugin for copying compiled asset files to one or multiple deployment paths on the filesystem.
- Host: GitHub
- URL: https://github.com/chiiya/laravel-mix-filesystem-deployment
- Owner: chiiya
- License: mit
- Created: 2020-01-31T12:17:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-31T12:18:55.000Z (almost 5 years ago)
- Last Synced: 2024-10-05T02:41:11.604Z (about 1 month ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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
```js
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 |
| ----------------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`deployPaths`** | `[]` | **`REQUIRED`**. List of paths where the assets should be copied to. |
| `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. |## 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.```js
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,
});
});
```