main.js 1.0 KB

1234567891011121314151617181920212223
  1. /**
  2. * Site-wide JS bundle (→ js/v4-script.min.js) — replaces the gulp `js` output.
  3. *
  4. * Vendor comes from npm (so it's `npm update`-able). The two libs with no clean npm
  5. * package (DrawFillSVG, Rainbow) are small self-exposing files under src/vendor/.
  6. * The 2,834-line scripts.js pile + modernizr are dropped (dead or npm-replaced).
  7. * Page scripts (about.js, studio.js, …) stay separate and consume these globals.
  8. */
  9. import $ from 'jquery';
  10. window.$ = window.jQuery = $;
  11. import * as bootstrap from 'bootstrap'; // also registers BS5 data-api (offcanvas, etc.)
  12. window.bootstrap = bootstrap;
  13. import Cookies from 'js-cookie';
  14. window.Cookies = Cookies;
  15. import 'jquery-validation'; // → $.fn.validate (comment forms: about, single)
  16. import 'jquery-backstretch'; // → $.fn.backstretch (studio hero bg)
  17. import 'jquery-lazyload'; // → $.fn.lazyload (desk)
  18. import './vendor/drawfillsvg.js'; // self-exposes window.DrawFillSVG (about, studio)
  19. import './vendor/rainbow.js'; // self-exposes window.Rainbow (code page + data-language posts)