forked from zhuchunshu/SForum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
executable file
·66 lines (54 loc) · 1.52 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
let mix = require('laravel-mix');
function public_path($path) {
if ($path) {
return "./public/" + $path;
} else {
return "./public"
}
}
function resources_path($path) {
if ($path) {
return "./resources/" + $path;
} else {
return "./resources"
}
}
// app.js
mix.js(resources_path("js/app.js"), "js").version();
// install.js
mix.js(resources_path("js/install.js"), "js").version();
// vue.js
mix.js(resources_path("js/vue.js"), "js").vue({version: 3})
.webpackConfig((webpack) => {
return {
plugins: [
new webpack.DefinePlugin({
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false,
}),
],
};
}).version();
//admin
// login
mix.js(resources_path("js/admin/login.js"), "js/admin").version();
//EditFile
mix.js(resources_path("js/admin/EditFile.js"), "js/admin").version();
// error
mix.js(resources_path("js/admin/error.js"), "js/admin").version();
// component
mix.js(resources_path("js/admin/component.js"), "js/admin").version();
// setting
mix.js(resources_path("js/admin/setting.js"), "js/admin").version();
mix.js(resources_path("js/admin/index.js"), "js/admin").version();
// pay
mix.js(resources_path("js/admin/pay.js"), "js/admin").version();
try {
require("./plugins.mix")
} catch {
}
// app.css
mix.sass(resources_path("sass/app.scss"), "css").version();
// 设置public目录
mix.setPublicPath(public_path());
mix.setResourceRoot(resources_path());