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