jeudi 12 octobre 2017

Webpack mix verion files that use Copy or CopyDirectry

  • Laravel Mix Version: 1.4.5
  • Node Version: v6.10.2
  • NPM Version: 3.10.10
  • OS: windows 10 xampp

Description:

Undefined index when using copy/copyDirectory and

Steps To Reproduce:

Create 2 folders in resources

/css/afolder/afile.css

/css/another/anotherfile.css

Copy the folders with the following:

`mix.copy('resources/assets/css/', 'public/css', false);`

or

`mix.copyDirectory('resources/assets/css/', 'public/css');`

The files are copied fine, but when using

``

or

``

It returns back

Undefined index: css/afolder/afile.css

Undefined index: css/anotherfolder/anotherfile.css

The folders exists:

public/css/afolder/afile.css
public/css/anotherfolder/anotherfile.css

Mix manifest just shows the following

{
    "/js/app.js": "/js/app.js?id=0eaf1649511b8f1c3fd9",
    "/css/app.css": "/css/app.css?id=a86d86d0b7edd1152cc6"
}

Full webpackmix file

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

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/assets/js/app.js', 'public/js');

mix.copy('resources/assets/js/', 'public/js', false);

mix.copy('resources/assets/css/', 'public/css', false);

mix.sass('resources/assets/sass/app.scss', 'public/css');

mix.version();



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire