xref: /webtrees/webpack.mix.js (revision f71c313096fb2b920dc07aaaec585b4ba7a0f44b)
1// https://laravel-mix.com
2const mix = require('laravel-mix');
3
4// https://github.com/postcss/postcss-import
5const postcssImport = require('postcss-import')();
6
7// https://github.com/postcss/autoprefixer
8const postcssAutoprefixer = require('autoprefixer')();
9
10// https://github.com/elchininet/postcss-rtlcss
11const postcssRTLCSS = require('postcss-rtlcss')({safeBothPrefix: true});
12
13// https://github.com/bezoerb/postcss-image-inliner
14const postcssImageInliner = require('postcss-image-inliner')({
15  assetPaths: ['resources/css'],
16  maxFileSize: 0
17});
18
19// https://github.com/postcss/postcss-custom-properties
20// Enable CSS variables in IE
21const postcssCustomProperties = require('postcss-custom-properties')();
22
23mix
24  .autoload({
25    jquery: ['$', 'jQuery']
26  })
27  .setPublicPath('./public')
28  .sourceMaps(false)
29  .js('resources/js/vendor.js', 'public/js/vendor.min.js')
30  .babel(['resources/js/webtrees.js', 'resources/js/statistics.js', 'resources/js/treeview.js'], 'public/js/webtrees.min.js')
31  .copy('node_modules/leaflet/dist/images/*', 'public/css/images/')
32  .copy('node_modules/dejavu-fonts-ttf/ttf/DejaVuSans.ttf', 'resources/fonts/')
33  .options({
34    processCssUrls: false,
35    postCss: [
36      postcssImport,
37      postcssRTLCSS,
38      postcssAutoprefixer,
39      postcssImageInliner,
40      postcssCustomProperties
41    ]
42  })
43  .postCss('resources/css/administration.css', 'public/css/administration.min.css')
44  .postCss('resources/css/clouds.css', 'public/css/clouds.min.css')
45  .postCss('resources/css/colors.css', 'public/css/colors.min.css')
46  .postCss('resources/css/colors/aquamarine.css', 'public/css/colors/aquamarine.min.css')
47  .postCss('resources/css/colors/ash.css', 'public/css/colors/ash.min.css')
48  .postCss('resources/css/colors/belgianchocolate.css', 'public/css/colors/belgianchocolate.min.css')
49  .postCss('resources/css/colors/bluelagoon.css', 'public/css/colors/bluelagoon.min.css')
50  .postCss('resources/css/colors/bluemarine.css', 'public/css/colors/bluemarine.min.css')
51  .postCss('resources/css/colors/coffeeandcream.css', 'public/css/colors/coffeeandcream.min.css')
52  .postCss('resources/css/colors/coldday.css', 'public/css/colors/coldday.min.css')
53  .postCss('resources/css/colors/greenbeam.css', 'public/css/colors/greenbeam.min.css')
54  .postCss('resources/css/colors/mediterranio.css', 'public/css/colors/mediterranio.min.css')
55  .postCss('resources/css/colors/mercury.css', 'public/css/colors/mercury.min.css')
56  .postCss('resources/css/colors/nocturnal.css', 'public/css/colors/nocturnal.min.css')
57  .postCss('resources/css/colors/olivia.css', 'public/css/colors/olivia.min.css')
58  .postCss('resources/css/colors/pinkplastic.css', 'public/css/colors/pinkplastic.min.css')
59  .postCss('resources/css/colors/sage.css', 'public/css/colors/sage.min.css')
60  .postCss('resources/css/colors/shinytomato.css', 'public/css/colors/shinytomato.min.css')
61  .postCss('resources/css/colors/tealtop.css', 'public/css/colors/tealtop.min.css')
62  .postCss('resources/css/fab.css', 'public/css/fab.min.css')
63  .postCss('resources/css/minimal.css', 'public/css/minimal.min.css')
64  .postCss('resources/css/webtrees.css', 'public/css/webtrees.min.css')
65  .postCss('resources/css/xenea.css', 'public/css/xenea.min.css')
66  .postCss('resources/css/vendor.css', 'public/css/vendor.min.css');
67