aboutsummaryrefslogtreecommitdiffstats
path: root/src/js
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-10-31 22:03:04 +0100
committerArmand Philippot <git@armandphilippot.com>2021-10-31 22:03:04 +0100
commitc64a7bd26fefb53aee53667cf33e2c72b7d07311 (patch)
tree332cac2337dd4b9c1b11e98683240274731bbb19 /src/js
parent3be752d822e12a34ff388b98f8654ab02a8ea586 (diff)
build: use php dotenv instead of js to inject style.js in dev mode
Diffstat (limited to 'src/js')
-rw-r--r--src/js/app.js15
-rw-r--r--src/js/utilities/helpers.js13
2 files changed, 3 insertions, 25 deletions
diff --git a/src/js/app.js b/src/js/app.js
index 38aee0e..8e23ca9 100644
--- a/src/js/app.js
+++ b/src/js/app.js
@@ -11,7 +11,7 @@ import {
showFromBottom,
showFromLeft,
} from './utilities/animations';
-import { isSmallVw, isStyleJsExists } from './utilities/helpers';
+import { isSmallVw } from './utilities/helpers';
/**
* Show/hide header and footer with slide animation (left).
@@ -304,18 +304,6 @@ function printProjectsNav() {
}
/**
- * 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);
- }
-}
-
-/**
* Load corresponding project if the requested page contains a hash.
*/
function printRequestedPage() {
@@ -371,7 +359,6 @@ function init() {
setAppLocale();
translateHTMLContent();
replaceLegalNoticeLink();
- loadWebpackStyles();
printProjectsNav();
updateView();
listenWindowSize();
diff --git a/src/js/utilities/helpers.js b/src/js/utilities/helpers.js
index 470c49c..8cc88c9 100644
--- a/src/js/utilities/helpers.js
+++ b/src/js/utilities/helpers.js
@@ -6,14 +6,5 @@ function isSmallVw() {
return window.innerWidth < 1200;
}
-/**
- * Check if /assets/styles.js exists (Webpack dev mode).
- * @returns {Boolean} True if style.js exists ; false otherwise.
- */
-async function isStyleJsExists() {
- const filePath = 'assets/js/style.js';
- const response = await fetch(filePath);
- return response.status === 200;
-}
-
-export { isSmallVw, isStyleJsExists };
+// eslint-disable-next-line import/prefer-default-export
+export { isSmallVw };