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');
webpack.mix
文件没有问题,mix.babel 工作得很好,问题是我使用的是Ubuntu
,当libs.js
文件被创建时,它在默认情况下是只读的,它阻止了编译,所以我不得不改变它来读写chmod。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.