-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.mix.css.js
97 lines (87 loc) · 2.5 KB
/
webpack.mix.css.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
const mix = require('laravel-mix');
const path = require('path')
const webpack = require('webpack')
const purgecss = require('@fullhuman/postcss-purgecss')
require('laravel-mix-merge-manifest')
/*
|--------------------------------------------------------------------------
| 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.
|
*/
/////////////
// OPTIONS //
/////////////
mix.override((config) => {
delete config.watchOptions;
});
const sassOptions = {
sassOptions: {
includePaths: ['node_modules']
},
implementation: require('sass')
}
const postCss = [
require('@mjhenkes/postcss-rtl')
]
if (mix.inProduction()) {
postCss.push(
purgecss({
content: [
'./public/js/**/*.js',
],
variables: true,
keyframes: true,
fontFace: true,
safelist: {
greedy: [
/-(leave|enter|appear)(|-(to|from|active))$/,
/^(?!(|.*?:)cursor-move).+-move$/,
/^router-link(|-exact)-active$/,
/data-v-.*/,
/mdk-box--primary/,
/mdk-(drawer|reveal)/,
/sidebar-submenu/,
/sm-indent/,
/sidebar-(light|dark-pickled-bluewood)/,
/navbar-(light|dark-pickled-bluewood)/,
/avatar-.*/,
/btn-(flush|white|accent|dark|outline-(white|dark)|lg)/,
/badge-(accent|dark|notifications)/,
/text-rating/,
/pagination-xsm/,
/icon-holder--(primary|dark|light|outline-accent)/,
/bg-(body|secondary|success|danger|warning|info)/,
/alert-(success|danger|warning|info)/,
/spinner-grow/,
]
}
})
)
}
mix
.setPublicPath('public')
.options({ postCss })
.webpackConfig({
resolve: {
symlinks: false
}
})
mix
.sass('resources/scss/app.scss', 'public/css/main.css', sassOptions)
.sass('resources/scss/vendor/fontawesome.scss', 'public/css/vendor', sassOptions)
.sass('resources/scss/vendor/material-icons.scss', 'public/css/vendor', sassOptions)
.sass('resources/scss/vendor/quill.scss', 'public/css/vendor', sassOptions)
mix.combine([
'public/css/vendor/fontawesome.css',
'public/css/vendor/material-icons.css',
'public/css/vendor/quill.css',
'public/css/main.css'
], 'public/css/app.css')
mix
.version()
.mergeManifest()