I wrote the following code that combined CSS and JS files with the Webpack.mix.js and the correct result, but the version function does not work for the JS file! What can I do to get it right, and both CSS and JS become version?
webpack.mix.js
mix.setPublicPath('/')
.copy('node_modules/bootstrap/dist/js/bootstrap.js', 'resources/js')
.copy('node_modules/jquery/dist/jquery.js', 'resources/js')
.scripts([
'resources/js/bootstrap.js',
'resources/js/jquery.js'
], 'resources/js/app.js');
mix.sass('resources/sass/app.scss', 'public/css')
.styles([
'public/css/app.css',
'public/css/myCss.css'
], 'public/css/all.css')
.js('resources/js/app.js', 'public/js')
.version();
mix-manifest.json
{
"/css/app.css": "/css/app.css?id=35978cdc6a38f7d64fbb",
"/css/all.css": "/css/all.css?id=eda19119aa76ef087fde"
}
i added <script src="{{ mix('js/all.js') }}"></script> into my Blade file