1.0.0 • Published 4 years ago

laravel-mix-dload v1.0.0

Weekly downloads
96
License
MIT
Repository
github
Last release
4 years ago

Laravel Mix Download

This extension provides the possibility to download files for your Mix (v2.1 and up) builds.

Usage

First, install the extension.

npm install laravel-mix-dload --save-dev

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

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

require('laravel-mix-dload');

mix
    .js('resources/assets/js/app.js', 'public/js')
    .less('resources/assets/less/app.less', 'public/css')
    .download({
        enabled: mix.inProduction(),
        urls: [
            {
                "url": "https://www.google-analytics.com/analytics.js",
                "dest": "./web/js/"
            },
        ],
    });

And you're done! Compile everything down with npm run prod.

Options

Only urls is required - all other options are optional. If you don't want to use the paths object you can simply define your base and templates in the url and template options from urls

NameTypeDefaultDescription
enabledbooleanmix.inProduction()set to false if you don't want to download files, set to true if you always want to download files no matter the env setting.
urlsarray[]An array of url objects, each with a url and dest: { url: 'http://example.com/test.jpg', dest: './web/img' }
deststring''The string where the downloaded files need to be saved this overrides the specific url destination setting
1.0.0

4 years ago

0.2.0

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago