Apr 30, 2021
0
Level 4
mix creates css under js folder
Laravel 8 and mix 6.
I discovered mix is generating a js/vendor.css file
Why ?
my larave-mix is
const mix = require('laravel-mix');
const webpack = require('webpack');
const env = process.env.NODE_ENV || 'development';
const config = require('./config');
const extracted_to_vendor = [
"axios",
"bootstrap",
"bootstrap-datepicker",
"bootstrap-select",
"bootstrap-toggle",
"dropzone",
"es6-promise",
"fontawesome",
"js-cookie",
"jwt-decode",
"lodash",
"select2",
"summernote",
"sweetalert2",
"toastr",
"v-select2-component",
"vue-carousel",
"vue-progressbar",
"vue-snotify",
"vue2-filters",
"vuejs-dialog",
"vuex",
'@fullcalendar/core',
'@fullcalendar/daygrid',
'@fullcalendar/bootstrap',
];
const uglifyOptions = {
development: {},
production: {
uglifyOptions: {
compress: {
warnings: false,
conditionals: true,
unused: true,
comparisons: true,
sequences: true,
dead_code: true,
evaluate: true,
if_return: true,
join_vars: true,
},
output: {
comments: false
}
}
}
};
mix
.extract(['jquery', './resources/assets/js/jquery-global.js'], 'public/js/jquery.js')
.extract(extracted_to_vendor, 'public/js/vendor.js')
mix.js('resources/assets/js/frontend.js', 'public/js').vue({
extractStyles: true,
globalStyles: false
})
mix.sass('resources/assets/sass/frontend/frontend.scss', 'public/css')
mix.js('resources/assets/js/backend.js', 'public/js')
mix.sass('resources/assets/sass/backend/backend.scss', 'public/css')
mix.browserSync(config.browserSyncUrl)
.options({
terser: {
extractComments: false,
},
processCssUrls: false,
uglify: uglifyOptions[env]
});
mix.disableSuccessNotifications();
mix.webpackConfig({
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
Vue: "vue"
})
],
resolve: {
fallback: {
"path": require.resolve("path-browserify")
}
}
});
mix.version();
Please or to participate in this conversation.