xref: /webtrees/webpack.mix.js (revision f4c767fd89cdb62ee54edec032285924cd767af7)
1// https://laravel-mix.com
2const mix = require("laravel-mix");
3
4// https://github.com/postcss/postcss-import
5const postcss_import = require("postcss-import")();
6
7// https://github.com/postcss/autoprefixer
8const postcss_autoprefixer = require("autoprefixer")();
9
10// https://github.com/jakob101/postcss-inline-rtl
11const postcss_rtl = require("postcss-rtl")();
12
13// https://github.com/bezoerb/postcss-image-inliner
14const postcss_image_inliner = 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 postcss_custom_properties = require("postcss-custom-properties")();
22
23mix
24    .autoload({
25        jquery: ["$", "jQuery"],
26    })
27    .setPublicPath('./public')
28    .sourceMaps()
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/leaflet-control-geocoder/dist/images/*", "public/css/images/")
33    .copy("node_modules/dejavu-fonts-ttf/ttf/DejaVuSans.ttf", "resources/fonts/")
34    .options({
35            processCssUrls: false,
36            postCss: [
37                postcss_import,
38                postcss_rtl,
39                postcss_autoprefixer,
40                postcss_image_inliner,
41                postcss_custom_properties,
42            ]
43    })
44    .postCss("resources/css/administration.css", "public/css/administration.min.css")
45    .postCss("resources/css/clouds.css", "public/css/clouds.min.css")
46    .postCss("resources/css/colors.css", "public/css/colors.min.css")
47    .postCss("resources/css/colors/aquamarine.css", "public/css/colors/aquamarine.min.css")
48    .postCss("resources/css/colors/ash.css", "public/css/colors/ash.min.css")
49    .postCss("resources/css/colors/belgianchocolate.css", "public/css/colors/belgianchocolate.min.css")
50    .postCss("resources/css/colors/bluelagoon.css", "public/css/colors/bluelagoon.min.css")
51    .postCss("resources/css/colors/bluemarine.css", "public/css/colors/bluemarine.min.css")
52    .postCss("resources/css/colors/coffeeandcream.css", "public/css/colors/coffeeandcream.min.css")
53    .postCss("resources/css/colors/coldday.css", "public/css/colors/coldday.min.css")
54    .postCss("resources/css/colors/greenbeam.css", "public/css/colors/greenbeam.min.css")
55    .postCss("resources/css/colors/mediterranio.css", "public/css/colors/mediterranio.min.css")
56    .postCss("resources/css/colors/mercury.css", "public/css/colors/mercury.min.css")
57    .postCss("resources/css/colors/nocturnal.css", "public/css/colors/nocturnal.min.css")
58    .postCss("resources/css/colors/olivia.css", "public/css/colors/olivia.min.css")
59    .postCss("resources/css/colors/pinkplastic.css", "public/css/colors/pinkplastic.min.css")
60    .postCss("resources/css/colors/sage.css", "public/css/colors/sage.min.css")
61    .postCss("resources/css/colors/shinytomato.css", "public/css/colors/shinytomato.min.css")
62    .postCss("resources/css/colors/tealtop.css", "public/css/colors/tealtop.min.css")
63    .postCss("resources/css/fab.css", "public/css/fab.min.css")
64    .postCss("resources/css/minimal.css", "public/css/minimal.min.css")
65    .postCss("resources/css/webtrees.css", "public/css/webtrees.min.css")
66    .postCss("resources/css/xenea.css", "public/css/xenea.min.css")
67    .postCss("resources/css/vendor.css", "public/css/vendor.min.css");
68