-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
119 lines (105 loc) · 3.85 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
const mix = require('laravel-mix');
const argv = require('minimist')(process.argv.slice(2));
const src = {
user: {
js: ['resources/js/main.js',
'resources/js/scroll.js',
'resources/js/utilities.js',
'resources/js/schedule_tutors.js',
'resources/js/schedule_user.js',
'resources/js/profile.js',
'resources/js/registered_tutors.js',
'resources/js/registered_users.js',
'resources/js/saved_tutors.js',
'resources/js/signup.js',
'resources/js/tutor_details.js',
'resources/js/tutor_registration_form.js',
'resources/js/contact.js',
'resources/js/post.js',
'resources/js/news.js',
'resources/js/homepage.js'
],
css: ['resources/css/style.css',
//'resources/css/404/main.css',
'resources/css/footer/main.css',
'resources/css/login/main.css',
'resources/css/material-icon/main.css',
'resources/css/navbar/main.css',
'resources/css/register_schedule_tutors/main.css',
'resources/css/saved_tutors/main.css',
'resources/css/schedule_tutors/main.css',
'resources/css/signup/main.css',
'resources/css/teacher_list/main.css',
'resources/css/TrangChu/main.css',
'resources/css/tutor_registration_form/main.css',
'resources/css/user_detail/main.css',
'resources/css/utilities/main.css',
'resources/css/contact/main.css',
'resources/css/post/main.css',
'resources/css/news/main.css'
]
},
admin: {
js: ['admin/resources/js/modules/image_viewer.js',
'admin/resources/js/main.js',
// 'admin/resources/js/carousel.js',
'admin/resources/js/managersubjects.js',
'admin/resources/js/page_editpost.js',
'admin/resources/js/topicmanager.js',
'admin/resources/js/tutormanagers.js',
'admin/resources/js/usermanager.js',
'admin/resources/js/contact.js',
'resources/js/post.js',
'admin/resources/js/category.js',
'admin/resources/js/categorynew.js',
'admin/resources/js/categoryedit.js',
'admin/resources/js/article.js',
'admin/resources/js/articleedit.js'
],
css: ['admin/resources/css/carousel_post/main.css',
'admin/resources/css/category/main.css',
'admin/resources/css/material-icon/main.css',
'admin/resources/css/print/print.css',
'admin/resources/css/sliderbar/main.css',
'admin/resources/css/user_detail/main.css',
'admin/resources/css/utilities/main.css',
'admin/resources/css/contact/main.css',
'admin/resources/css/style.css'
]
}
}
const dest = {
user: {
js: 'public/js',
css: 'public/css'
},
admin: {
js: 'public/js',
css: 'public/css'
}
}
// For User
if (argv.user) {
mix.js(src.user.js, `${dest.user.js}/app.js`) // Output: public/js/app.js
.styles(src.user.css, `${dest.user.css}/app.css`) // Output: public/css/app.css
}
// For Admin
else if (argv.admin) {
mix.js(src.admin.js, `${dest.admin.js}/admin.js`) // Output: public/js/admin.js
.styles(src.admin.css, `${dest.admin.css}/admin.css`) // Output: public/css/admin.css
}
// Both
else {
mix.js(src.user.js, `${dest.user.js}/app.js`)
.styles(src.user.css, `${dest.user.css}/app.css`)
.js(src.admin.js, `${dest.admin.js}/admin.js`)
.styles(src.admin.css, `${dest.admin.css}/admin.css`)
}
mix.setPublicPath('public')
// }
// mix.js(, 'public/js')
// .styles(, 'public/css/main.css')
// setPublicPath('public');
if (mix.inProduction()) {
mix.version();
}