-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
85 lines (74 loc) · 2.73 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
const mix = require('laravel-mix'),
webpack = require('webpack'),
purgecss = require('@fullhuman/postcss-purgecss');
require('laravel-mix-purgecss');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix
.js('assets/js/site.js', 'public/js')
// .sass('resources/sass/fa-fonts.scss', 'public/css')
.sass('assets/scss/site.scss', 'public/css')
.combine
([
'node_modules/jquery/dist/jquery.min.js',
'node_modules/foundation-sites/dist/js/foundation.min.js',
'node_modules/fullpage.js/dist/fullpage.min.js',
'node_modules/spotlight.js/dist/js/spotlight.min.js'
], 'public/js/vendor.js')
.copy('node_modules/fullpage.js/dist/fullpage.css', 'public/css')
.copy('node_modules/spotlight.js/dist/css/spotlight.css', 'public/css')
.copy('node_modules/spotlight.js/dist/img', 'public/img')
.purgeCss({
extend: {
content: [
path.join(__dirname, "*.php"),
path.join(__dirname, "parts/*.php"),
path.join(__dirname, "assets/js/vue/*.vue"),
],
whitelistPatterns: [/hljs/],
},
})
.webpackConfig({
resolve: {
modules: [
'node_modules'
],
},
plugins: [
new webpack.LoaderOptionsPlugin({
test: /\.s[ac]ss$/,
options: {
includePaths: ['resources/assets/sass', 'node_modules/foundation-site/scss']
}
})
]
});
// if(mix.inProduction()){
// mix.webpackConfig({
// plugins:[
// new purgecss({
// content: [
// "*.php",
// "parts/*.php",
// "assets/js/vue/*.vue"
// ],
// // This is the function used to extract class names from your templates
// defaultExtractor: content => {
// // Capture as liberally as possible, including things like `h-(screen-1.5)`
// const broadMatches = content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || []
// // Capture classes within other delimiters like .block(class="w-1/2") in Pug
// const innerMatches = content.match(/[^<>"'`\s.()]*[^<>"'`\s.():]/g) || []
// return broadMatches.concat(innerMatches)
// }
// })
// ]
// })
// }