xref: /webtrees/webpack.mix.js (revision 71378461661e7642e52abe7d41c9cfffb3e5369b)
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.styles([
24    "node_modules/bootstrap/dist/css/bootstrap.min.css",
25    "node_modules/datatables.net-bs4/css/dataTables.bootstrap4.css",
26    "node_modules/@fortawesome/fontawesome-free/css/regular.css",
27    "node_modules/@fortawesome/fontawesome-free/css/solid.css",
28    "node_modules/@fortawesome/fontawesome-free/css/fontawesome.css",
29    "resources/css/begin-ignore-rtl.css",
30    "node_modules/select2/dist/css/select2.min.css",
31    "resources/css/end-ignore-rtl.css",
32    "node_modules/typeahead.js-bootstrap4-css/typeaheadjs.css",
33    "node_modules/leaflet/dist/leaflet.css",
34    "node_modules/beautifymarker/leaflet-beautify-marker-icon.css",
35    "node_modules/leaflet-geosearch/dist/style.css",
36    "node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css",
37    "node_modules/leaflet.markercluster/dist/MarkerCluster.css",
38], "public/css/vendor.css");
39
40mix
41    .autoload({
42        jquery: ["$", "jQuery"],
43    })
44    .setPublicPath('./public')
45    .sourceMaps()
46    .js("resources/js/vendor.js", "public/js/vendor.min.js")
47    .babel(["resources/js/webtrees.js", "resources/js/treeview.js"], "public/js/webtrees.min.js")
48    .copy("node_modules/leaflet/dist/images/*", "public/css/images/")
49    .copy("node_modules/dejavu-fonts-ttf/ttf/DejaVuSans.ttf", "resources/fonts/")
50    .copy("node_modules/@fortawesome/fontawesome-free/webfonts/fa-regular-*", "public/webfonts/")
51    .copy("node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-*", "public/webfonts/")
52    .options({
53            processCssUrls: false,
54            postCss: [
55                postcss_rtl,
56                postcss_import,
57                postcss_autoprefixer,
58                postcss_image_inliner,
59                postcss_custom_properties,
60            ]
61    })
62    .postCss("resources/css/administration.css", "public/css/administration.min.css")
63    .postCss("resources/css/clouds.css", "public/css/clouds.min.css")
64    .postCss("resources/css/colors.css", "public/css/colors.min.css")
65    .postCss("resources/css/colors/aquamarine.css", "public/css/colors/aquamarine.min.css")
66    .postCss("resources/css/colors/ash.css", "public/css/colors/ash.min.css")
67    .postCss("resources/css/colors/belgianchocolate.css", "public/css/colors/belgianchocolate.min.css")
68    .postCss("resources/css/colors/bluelagoon.css", "public/css/colors/bluelagoon.min.css")
69    .postCss("resources/css/colors/bluemarine.css", "public/css/colors/bluemarine.min.css")
70    .postCss("resources/css/colors/coffeeandcream.css", "public/css/colors/coffeeandcream.min.css")
71    .postCss("resources/css/colors/coldday.css", "public/css/colors/coldday.min.css")
72    .postCss("resources/css/colors/greenbeam.css", "public/css/colors/greenbeam.min.css")
73    .postCss("resources/css/colors/mediterranio.css", "public/css/colors/mediterranio.min.css")
74    .postCss("resources/css/colors/mercury.css", "public/css/colors/mercury.min.css")
75    .postCss("resources/css/colors/nocturnal.css", "public/css/colors/nocturnal.min.css")
76    .postCss("resources/css/colors/olivia.css", "public/css/colors/olivia.min.css")
77    .postCss("resources/css/colors/pinkplastic.css", "public/css/colors/pinkplastic.min.css")
78    .postCss("resources/css/colors/sage.css", "public/css/colors/sage.min.css")
79    .postCss("resources/css/colors/shinytomato.css", "public/css/colors/shinytomato.min.css")
80    .postCss("resources/css/colors/tealtop.css", "public/css/colors/tealtop.min.css")
81    .postCss("resources/css/fab.css", "public/css/fab.min.css")
82    .postCss("resources/css/minimal.css", "public/css/minimal.min.css")
83    .postCss("resources/css/webtrees.css", "public/css/webtrees.min.css")
84    .postCss("resources/css/xenea.css", "public/css/xenea.min.css")
85    .postCss("public/css/vendor.css", "public/css/vendor.min.css");
86