-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
webpack.mix.js
85 lines (75 loc) · 2.48 KB
/
webpack.mix.js
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel applications. By default, we are compiling the CSS
| file for the application as well as bundling up all the JS files.
|
*/
var publicPath = "public";
var resourcesPath = "resources/assets";
var pathJS = resourcesPath + "/js";
var COMPILE = "all";
// do not extract/save .LICENSE.txt files
mix.options({
terser: {
extractComments: false
}
});
mix.webpackConfig(webpack => {
return {
resolve: {
fallback: {
stream: require.resolve('stream-browserify'),
tty: require.resolve('tty-browserify'),
},
alias: {
jQuery: 'jquery',
},
},
};
});
if (COMPILE == "all" || COMPILE == "js") {
// update public path for js to compile into /resources
mix.js("resources/assets/js/admin.js", "js/vendor/admin_compiled.js");
mix.js("resources/assets/js/website.js", "js/vendor/website_compiled.js");
mix.scripts(
[
"public/js/vendor/admin_compiled.js",
pathJS + "/titan/buttons.js",
pathJS + "/titan/datatables.js",
pathJS + "/titan/forms.js",
pathJS + "/titan/google_maps.js",
pathJS + "/titan/notifications.js",
pathJS + "/titan/notify.js",
pathJS + "/titan/pagination.js",
pathJS + "/titan/social_media.js",
pathJS + "/titan/utils.js",
pathJS + "/titan/titan.js"
],
publicPath + "/js/admin.js"
);
//website js
mix.scripts(
[
"public/js/vendor/website_compiled.js",
pathJS + "/titan/buttons.js",
// pathJS + '/titan/datatables.js',
pathJS + "/titan/forms.js",
pathJS + "/titan/google_maps.js",
pathJS + "/titan/pagination.js",
pathJS + "/titan/social_media.js",
pathJS + "/titan/utils.js",
pathJS + "/titan/titan.js",
pathJS + "/website/utils.js",
],
publicPath + "/js/website.js"
);
}
if (COMPILE == "all" || COMPILE == "css") {
mix.sass("resources/assets/sass/admin.scss", "public/css");
mix.sass("resources/assets/sass/website.scss", "public/css");
}