Merge branch 'update-compilation-2020' of github.com:locomotivemtl/locomotive-boilerplate into update-compilation-2020

This commit is contained in:
Quentin Hocdé
2021-03-05 09:25:24 -05:00
7 changed files with 19 additions and 27 deletions

View File

@@ -12,9 +12,5 @@ trim_trailing_whitespace = true
[*.{md,markdown}]
trim_trailing_whitespace = false
[{*.yml,*.json}]
indent_size = 4
indent_style = space
[*.{ms,mustache}]
insert_final_newline = false

View File

@@ -8,9 +8,10 @@
## Requirements
| Name | Version |
| ---------- | ------- |
| Name | Version |
| ---------- | -------- |
| [Node] | > 14.15 |
[Node]: https://nodejs.org/en/
You can use [nvm](https://github.com/nvm-sh/nvm) to install the node version in `.nvmrc`.

View File

@@ -7,7 +7,6 @@ export default class extends module {
}
init() {
const load = new modularLoad({
enterDelay: 0,
transitions: {

View File

@@ -7,7 +7,6 @@ export default class extends module {
}
init() {
this.scroll = new LocomotiveScroll({
el: this.el,
smooth: true

View File

@@ -9,18 +9,14 @@ export function concatVendors() {
// Get all files in scripts/vendors/
const files = fs.readdirSync(paths.scripts.vendors.src);
// Extract no-JS files
var jsFiles = files.filter((f)=>{
if(f.includes('.js')) {
return true;
} else {
return false;
}
// Exclude files that are not JavaScript
var jsFiles = files.filter((file) => {
return file.includes('.js');
});
// Add absolute path
jsFiles = jsFiles.map((f) => {
return `${paths.scripts.vendors.src + f}`;
// Prepend absolute path
jsFiles = jsFiles.map((file) => {
return `${paths.scripts.vendors.src + file}`;
});

View File

@@ -7,10 +7,14 @@ export function generateSpriteSVG() {
console.time('Sprite generated in');
// Write sprite content on disk
mixer([paths.svgs.src + '*.svg'], {spriteConfig: { usages: false }})
.then((result) => {
mixer([
paths.svgs.src + '*.svg'
], {
spriteConfig: {
usages: false
}
}).then((result) => {
result.write(paths.svgs.dest + 'sprite.svg');
message('SVG Sprite generated', 'success', 'Sprite generated in');
});
}

View File

@@ -2,19 +2,16 @@
import kleur from 'kleur';
export default function message(text, type, timerId) {
if(type === 'success') {
if (type === 'success') {
console.log(kleur.bgGreen().black(`${text}`));
if(timerId !== undefined) {
if (timerId !== undefined) {
console.timeEnd(timerId)
}
} else if (type === 'error') {
console.log(kleur.red().underline(`${text}`));
} else if (type === 'waiting') {
console.log(kleur.blue().italic(`${text}`));
console.log(kleur.blue().italic(`${text}`));
} else {
console.log(text);
}