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}] [*.{md,markdown}]
trim_trailing_whitespace = false trim_trailing_whitespace = false
[{*.yml,*.json}]
indent_size = 4
indent_style = space
[*.{ms,mustache}] [*.{ms,mustache}]
insert_final_newline = false insert_final_newline = false

View File

@@ -8,9 +8,10 @@
## Requirements ## Requirements
| Name | Version | | Name | Version |
| ---------- | ------- | | ---------- | -------- |
| [Node] | > 14.15 | | [Node] | > 14.15 |
[Node]: https://nodejs.org/en/ [Node]: https://nodejs.org/en/
You can use [nvm](https://github.com/nvm-sh/nvm) to install the node version in `.nvmrc`. 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() { init() {
const load = new modularLoad({ const load = new modularLoad({
enterDelay: 0, enterDelay: 0,
transitions: { transitions: {

View File

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

View File

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

View File

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

View File

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