-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
72 lines (66 loc) · 1.86 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
/**
* Laravel Mix Configuration
*
* We use Laravel Mix as an easy-to-understand interface for webpack,
* which can otherwise be quite complicated. Mix is super simple and
* works very well.
*
* @link https://laravel.com/docs/5.6/mix
*
* @author Bernskiold Media <[email protected]>
* @package BernskioldMedia\Equmeniakyrkan\Equmenisk
**/
const mix = require( 'laravel-mix' );
/**************************************************************
* Build Process
*
* This part handles all the compilation and concatenation of
* all the theme's resources.
*************************************************************/
/*
* Asset Directory Path
*/
const assetPaths = {
scripts: 'assets/scripts',
styles: 'assets/styles',
images: 'assets/images',
fonts: 'assets/fonts',
};
/*
* Set Laravel Mix options.
*
* @link https://laravel-mix.com/docs/5.0/css-preprocessors
*/
mix.options( {
processCssUrls: false,
postCss: [
require( 'postcss-preset-env' )( {
stage: 4,
browsers: [
'> 1%',
'last 2 versions',
'ie >= 11',
],
autoprefixer: { grid: true },
} ),
],
} );
/*
* Process the SCSS
*
* @link https://laravel-mix.com/docs/5.0/css-preprocessors
* @link https://github.com/sass/dart-sass#javascript-api
*/
const sassConfig = {
sassOptions: {
outputStyle: 'compressed',
indentType: 'tab',
indentWidth: 1,
},
};
// Process the scss files.
mix.sass( `${ assetPaths.styles }/src/admin-bar.scss`, `${ assetPaths.styles }/dist`, sassConfig )
.sass( `${ assetPaths.styles }/src/admin.scss`, `${ assetPaths.styles }/dist`, sassConfig )
.sass( `${ assetPaths.styles }/src/admin-download-manager.scss`, `${ assetPaths.styles }/dist`, sassConfig )
.sass( `${ assetPaths.styles }/src/admin-theme.scss`, `${ assetPaths.styles }/dist`, sassConfig )
.sass( `${assetPaths.styles}/src/block-editor.scss`, `${assetPaths.styles}/dist`, sassConfig );