-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.mix.rural.js
46 lines (41 loc) · 1.21 KB
/
webpack.mix.rural.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
/**
* Laravel mix - Rural theme
*
* Output:
* - rural.min.css
*/
const mix = require('laravel-mix');
const config = require('./webpack.mix.config');
require('laravel-mix-clean');
// https://github.com/postcss/autoprefixer
const postcssAutoprefixer = require('autoprefixer')();
// https://github.com/elchininet/postcss-rtlcss
const postcssRtl = require('postcss-rtlcss')({ safeBothPrefix: true });
// https://github.com/bezoerb/postcss-image-inliner
const postcssImageInliner = require('postcss-image-inliner')({
assetPaths: [config.images_dir],
maxFileSize: 0
});
// https://github.com/postcss/postcss-custom-properties
// Enable CSS variables in IE
const postcssCustomProperties = require('postcss-custom-properties')();
mix
.setPublicPath(config.public_dir + '/css')
.alias({
'~build': config.build_dir
})
.sass('src/sass/theme.scss', config.public_dir + '/css/rural.min.css', {
additionalData: '$maj-webtrees-dir: ' + config.webtrees_dir + ';'
})
.options({
processCssUrls: false,
postCss: [
postcssRtl,
postcssAutoprefixer,
postcssImageInliner,
postcssCustomProperties
]
})
.copy(config.images_dir + '/header.png', config.public_dir + '/images')
.clean()
;