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