Skip to content

Commit

Permalink
Added src alias to prevent complicated relative directory addressing.
Browse files Browse the repository at this point in the history
  • Loading branch information
smarteist committed Mar 7, 2022
1 parent dfa45ae commit 900cc32
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/assets/styles/abstracts/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $cyan: material-color('cyan', 'a400');
$gray: material-color('grey', '600');
$gray-dark: material-color('grey', '800');

$primary: material-color('orange', 'a200') !default;
$primary: material-color('yellow', '900') !default;
$secondary: material-color('blue', 'a400') !default;
$success: $green !default;
$info: $cyan !default;
Expand Down
4 changes: 2 additions & 2 deletions src/html/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
</head>
<body>

${ require('./partials/browserupgrade.html') }
${ require('src/html/partials/browserupgrade.html') }

<div class="d-flex flex-column h-100">

${ require('./partials/header.html') }
${ require('src/html/partials/header.html') }

<main class="d-flex h-100 align-items-center">
<div class="container">
Expand Down
4 changes: 2 additions & 2 deletions src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
</head>
<body>

${ require('./partials/browserupgrade.html') }
${ require('src/html/partials/browserupgrade.html') }

<div class="d-flex flex-column h-100">

${ require('./partials/header.html') }
${ require('src/html/partials/header.html') }

<main class="d-flex h-100 align-items-center">
<div class="container">
Expand Down
6 changes: 1 addition & 5 deletions src/html/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
<div class="container">
<nav class="navbar">
<a class="navbar-brand" href="#">
<svg height='50' width='50' fill="currentColor" viewBox="0 0 100 100">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M78.744,32.862C78.497,32.336,77.968,32,77.387,32H61.087l7.751-26.191 c0.204-0.69-0.11-1.427-0.749-1.758c-0.64-0.331-1.423-0.161-1.868,0.403l-31.62,40.117c-0.355,0.452-0.422,1.066-0.171,1.583 S35.206,47,35.78,47h16.184l-9.276,26.136c-0.243,0.685,0.04,1.446,0.672,1.806c0.233,0.132,0.488,0.196,0.74,0.196 c0.435,0,0.862-0.188,1.156-0.542l33.285-40.138C78.913,34.01,78.992,33.388,78.744,32.862z M48.342,66.174l7.159-20.173 c0.163-0.459,0.093-0.969-0.188-1.367C55.032,44.237,54.575,44,54.088,44H38.873l24.875-31.559l-6.106,20.633 c-0.134,0.454-0.046,0.944,0.237,1.323C58.161,34.777,58.606,35,59.079,35h15.115L48.342,66.174z M37.466,63.187l1.472,3.024 c0.233,0.479,0.712,0.757,1.211,0.757c0.198,0,0.398-0.044,0.588-0.136c0.668-0.325,0.947-1.131,0.621-1.8l-1.472-3.024 c-0.326-0.668-1.132-0.947-1.8-0.621C37.419,61.712,37.141,62.518,37.466,63.187z M61.489,79.187l-3.179-1.095 c-0.702-0.242-1.469,0.132-1.711,0.834c-0.242,0.703,0.131,1.469,0.834,1.711l3.179,1.095c0.145,0.05,0.293,0.074,0.438,0.074 c0.559,0,1.081-0.35,1.273-0.908C62.566,80.195,62.192,79.429,61.489,79.187z M41.764,80.037 c-0.647-0.373-1.469-0.148-1.838,0.497l-3.37,5.87c-0.371,0.645-0.148,1.468,0.497,1.838c0.211,0.122,0.442,0.179,0.669,0.179 c0.467,0,0.92-0.243,1.169-0.676l3.37-5.87C42.632,81.23,42.409,80.407,41.764,80.037z M35.793,90.447 c-0.646-0.37-1.468-0.147-1.838,0.498l-1.978,3.446c-0.37,0.645-0.147,1.468,0.498,1.838c0.211,0.121,0.441,0.179,0.668,0.179 c0.467,0,0.92-0.243,1.169-0.677l1.978-3.446C36.661,91.64,36.438,90.817,35.793,90.447z M27.242,70.225l6.356,2.193 c0.146,0.05,0.293,0.074,0.439,0.074c0.559,0,1.081-0.35,1.273-0.908c0.242-0.703-0.131-1.469-0.834-1.712l-6.356-2.193 c-0.705-0.241-1.47,0.131-1.712,0.834C26.166,69.215,26.539,69.982,27.242,70.225z M67.785,81.822l-1.965-0.68 c-0.701-0.242-1.468,0.13-1.712,0.833c-0.243,0.703,0.129,1.469,0.833,1.712l1.965,0.68c0.146,0.05,0.294,0.074,0.44,0.074 c0.558,0,1.08-0.35,1.272-0.907C68.86,82.832,68.488,82.065,67.785,81.822z M68.172,63.807l-13.6,6.624 c-0.669,0.326-0.947,1.131-0.621,1.8c0.233,0.479,0.712,0.757,1.211,0.757c0.198,0,0.399-0.044,0.588-0.136l13.6-6.624 c0.669-0.326,0.947-1.131,0.621-1.8C69.646,63.759,68.839,63.482,68.172,63.807z M37.421,76.317 c-0.327-0.669-1.131-0.947-1.8-0.621l-13.598,6.624c-0.668,0.326-0.946,1.132-0.621,1.8c0.233,0.479,0.712,0.757,1.211,0.757 c0.198,0,0.399-0.044,0.589-0.136l13.598-6.624C37.469,77.792,37.747,76.986,37.421,76.317z M49.558,80.5 c-0.326-0.669-1.132-0.946-1.8-0.621c-0.668,0.325-0.947,1.131-0.621,1.8l3.604,7.401c0.233,0.479,0.712,0.757,1.211,0.757 c0.198,0,0.398-0.044,0.588-0.136c0.668-0.325,0.947-1.131,0.621-1.8L49.558,80.5z M35.51,59.171 c0.233,0.479,0.712,0.757,1.211,0.757c0.198,0,0.399-0.044,0.589-0.136c0.668-0.326,0.946-1.132,0.621-1.8l-2.944-6.042 c-0.326-0.668-1.131-0.947-1.8-0.621c-0.668,0.326-0.946,1.132-0.621,1.8L35.51,59.171z"/>
</svg>

<img src="${ require('src/assets/images/logo.svg') }" alt="brand">
<strong class="d-inline">Frontend Starter</strong>
</a>

Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// JavaScript
import './scripts/main'
import 'src/scripts/main'

// Styles
import './assets/styles/main.scss'
import 'src/assets/styles/main.scss'

// Favicon
import './assets/images/favicon.ico'
import 'src/assets/images/favicon.ico'

// Web App Manifest
import './site.webmanifest'
import 'src/site.webmanifest'
6 changes: 3 additions & 3 deletions src/scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vendors
import './vendor/jquery'
import './vendor/bootstrap'
import './modules/darkmode-handler'
import 'src/scripts/vendor/jquery'
import 'src/scripts/vendor/bootstrap'
import 'src/scripts/modules/darkmode-handler'
6 changes: 6 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ module.exports = function (env, args) {
path: path.resolve(__dirname, 'dist'),
filename: './js/index.bundle.js',
},
// Defined to simplify complicated relative DIR addressing
resolve: {
alias: {
src: path.resolve(__dirname, 'src'),
}
},
// Generate sourcemaps for proper error messages
devtool: 'source-map',
performance: {
Expand Down

0 comments on commit 900cc32

Please sign in to comment.