forked from zuramai/mazer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
51 lines (48 loc) · 1.51 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
const mix = require("laravel-mix");
const sidebarItems = require("./src/sidebar-items.json");
const horizontalMenuItems = require("./src/horizontal-menu-items.json");
require("laravel-mix-nunjucks");
const assetsPath = "src/assets/";
mix
.sass(`${assetsPath}scss/app.scss`, "assets/css")
.sass(`${assetsPath}scss/bootstrap.scss`, "assets/css")
.sass(`${assetsPath}scss/pages/auth.scss`, "assets/css/pages")
.sass(`${assetsPath}scss/pages/error.scss`, "assets/css/pages")
.sass(`${assetsPath}scss/pages/email.scss`, "assets/css/pages")
.sass(`${assetsPath}scss/pages/chat.scss`, "assets/css/pages")
.sass(`${assetsPath}scss/widgets/chat.scss`, "assets/css/widgets")
.sass(`${assetsPath}scss/widgets/todo.scss`, "assets/css/widgets")
.js(`${assetsPath}js/mazer.js`, "assets/js")
.minify("dist/assets/js/mazer.js")
.setPublicPath("dist")
.options({
processCssUrls: false,
});
// mix.browserSync({
// proxy: 'mazer.test',
// });
mix.njk("src/*.html", "dist/", {
ext: ".html",
marked: null,
watch: true,
data: {
web_title: "Mazer Admin Dashboard",
sidebarItems,
horizontalMenuItems,
},
block: "content",
envOptions: {
watch: true,
noCache: true,
},
manageEnv: (nunjucks) => {
nunjucks.addFilter("containString", (str, containStr) => {
if (!str.length) return false;
return str.indexOf(containStr) >= 0;
});
nunjucks.addFilter("startsWith", (str, targetStr) => {
if (!str.length) return false;
return str.startsWith(targetStr);
});
},
});