1

I am using Laravel 5.5 , in webpack.mix file the mix.styles function works perfectly and i compile my css files perfectly but mix.scripts doesn't compile the js files i found in the documentation that mix.babel Its method signature is identical to scripts.mix so i used it but nothing changed

this is my webpack.mix.js 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')
   .sass('resources/assets/sass/app.scss', 'public/css');


mix.styles([
    'resources/assets/css/libs/blog-post.css',
    'resources/assets/css/libs/bootstrap.css',
    'resources/assets/css/libs/font-awesome.css',
    'resources/assets/css/libs/metisMenu.css',
    'resources/assets/css/libs/sb-admin-2.css',
    'resources/assets/css/libs/test.css'

], 'public/css/libs.css');

mix.babel([
    'resources/assets/js/libs/jquery.js',
    'resources/assets/js/libs/bootstrap.js',
    'resources/assets/js/libs/metisMenu.js',
    'resources/assets/js/sb-admin-2.js',
    'resources/assets/js/libs/scripts.js',
    'resources/assets/js/libs/test.js'

], 'public/js/libs.js');

1 Answer 1

1

There was no problem with the webpack.mix file the mix.babel works perfectly ,the problem was that i am using Ubuntu and when libs.js file was created it was read only by default and it was preventing the compiling so i had to change it to read and write chmod.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.