From 2afa7afed65d3a14c5f65c92d4f1a2345ca0ec1d Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sun, 24 Oct 2021 18:54:24 +0200 Subject: chore: load styles on development mode --- htdocs/src/js/app.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 htdocs/src/js/app.js (limited to 'htdocs/src/js/app.js') diff --git a/htdocs/src/js/app.js b/htdocs/src/js/app.js new file mode 100644 index 0000000..1b7bbc6 --- /dev/null +++ b/htdocs/src/js/app.js @@ -0,0 +1,22 @@ +import { isStyleJsExists } from './utilities/helpers'; + +/** + * Add style.js script for development purposes. + */ +function loadWebpackStyles() { + if (isStyleJsExists()) { + const head = document.querySelector('head'); + const script = document.createElement('script'); + script.src = 'assets/js/style.js'; + head.appendChild(script); + } +} + +/** + * Initialize the website with the projects list. + */ +function init() { + loadWebpackStyles(); +} + +init(); -- cgit v1.2.3