-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.mix.js
97 lines (92 loc) · 2.11 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
const mix = require('laravel-mix');
const path = require('path');
const tailwindcss = require('tailwindcss');
require('laravel-mix-purgecss');
require('laravel-mix-bundle-analyzer');
mix.disableSuccessNotifications();
mix.webpackConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, '+/js/'),
},
modules: ['node_modules'],
},
});
mix.options({
clearConsole: false,
hmrOptions: {
host: 'localhost',
port: 3000,
},
postCss: [require('tailwindcss')],
processCssUrls: false,
purifyCss: false,
terser: {
terserOptions: {
compress: {
drop_console: mix.inProduction(),
},
},
},
});
mix
.setPublicPath('./')
// .copyDirectory('+/fonts', 'assets/fonts')
.js('+/js/customizer.js', 'assets/js')
.js('+/js/main.js', 'assets/js')
.sass('+/scss/editor.scss', 'assets/css')
.sass('+/scss/login.scss', 'assets/css')
.sass('+/scss/main.scss', 'assets/css')
.sourceMaps()
.purgeCss({
extensions: ['js', 'php'],
folders: ['assets', 'templates'],
only: ['assets/css/editor.css', 'assets/css/main.css'],
whitelist: ['active'],
whitelistPatterns: [
/^(.*)-template(-.*)?$/,
/^(.*)?-?paged(-.*)?$/,
/^(.*)?-?single(-.*)?$/,
/^(post-type-)?archive(-.*)?$/,
/^admin-bar(-.*)?$/,
/^archive(-.*)?$/,
/^attachment(-.*)?$/,
/^attachmentid-(.*)?$/,
/^author(-.*)?$/,
/^blog(-.*)?$/,
/^category(-.*)?$/,
/^children(-.*)?$/,
/^date(-.*)?$/,
/^date-(.*)?$/,
/^depth(-.*)?$/,
/^error404(-.*)?$/,
/^has-/,
/^home(-.*)?$/,
/^in-/,
/^is-/,
/^menu(-.*)?$/,
/^nav(-.*)?$/,
/^navigation(-.*)?$/,
/^page(-.*)?$/,
/^post-(.*)?$/,
/^postid-(.*)?$/,
/^screen(-.*)?$/,
/^search(-.*)?$/,
/^swal/,
/^tag(-.*)?$/,
/^tags(-.*)?$/,
/^tax-(.*)?$/,
/^term-(.*)?$/,
/^wp(-.*)?$/,
],
})
.version()
.browserSync({
// files: [
// '+/js/**/*.js',
// '+/scss/**/*.scss',
// 'templates/**/*.php',
// ],
notify: false,
proxy: 'castor.test',
});