-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.mix.js
More file actions
70 lines (62 loc) · 1.79 KB
/
webpack.mix.js
File metadata and controls
70 lines (62 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const path = require('path');
const mix = require('laravel-mix');
const webpack = require('webpack');
const { version } = require('./package.json');
/*
|--------------------------------------------------------------------------
| 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/js/main.js', 'public/js');
mix.sass('resources/sass/app.scss', 'public/css');
mix.webpackConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources/js/coreui/'),
'static': path.resolve(__dirname, 'resources/static/')
}
},
plugins: [new webpack.DefinePlugin({ __VERSION: JSON.stringify(version) })]
});
mix.extend('vueOptions', (webpackConfig, vueOptions, ...args) => {
const vueLoader = webpackConfig.module.rules.find(loader => loader.loader === 'vue-loader');
vueLoader.options = require('webpack-merge').smart(vueLoader.options, vueOptions);
});
mix.vueOptions({
transformToRequire: {
'img': 'src',
'image': 'xlink:href',
'b-img': 'src',
'b-img-lazy': ['src', 'blank-src'],
'b-card': 'img-src',
'b-card-img': 'img-src',
'b-carousel-slide': 'img-src',
'b-embed': 'src'
}
});
mix.extract([
'axios',
'bootstrap',
'bootstrap-vue',
'chart.js',
'jquery',
'lodash',
'popper.js',
'select2',
'vue',
'vue-chartjs',
'vue-loading-spinner',
'vue-notification',
'vue-router',
'vue-sweetalert2',
'vuejs-datepicker',
'vuex'
]);
if (mix.inProduction()) mix.version();
else mix.sourceMaps();
if (process.platform === 'darwin') mix.disableNotifications();