Git Product home page Git Product logo

efin-1's Introduction

Efin html/css

To work with this project, follow these commands:

  • To install all dependencies: $ npm install;
  • To start the Gulp builder, use: $ npm run dev;
  • To build the project in "production" mode: $ npm run build;

What does Gulp do?

  • Minifies HTML in production mode;
  • Removes comments from HTML in production mode;
  • Compiles SCSS files, adds vendor prefixes;
  • Removes comments from SCSS files;
  • In production mode, minifies CSS and creates an uncompressed copy;
  • Converts fonts to .ttf, and from .ttf to .woff/.woff2;
  • Creates a file for font inclusion. This file is created at: src/scss/config/fonts.scss, and looks like this:
@font-face {
  font-family: Inter;
  font-display: swap;
  src: url('../fonts/Inter-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}

ATTENTION!!!

If the src/scss/config - folder already contains a fonts.scss - file, then when adding new fonts, you MUST DELETE the old fonts.scss file. Don't worry, when you run the build again, Gulp will convert all new fonts and create a new fonts.scss file.

Next, what else the build can do:

  • Compresses images and converts them to the .webp format, and includes them if the browser supports it;
  • Copies the /static folder and its contents to the final build. This means you can place any files in this folder, and they will be added to the final build;
  • With the command $ npm run svgSprite, it creates "SVG sprites";
  • Before each build, it cleans the final project folder to avoid building garbage;
  • With the command $ npm run zip, you can archive the final folder for the client with the project name;
  • Also, for development, gulp starts a server with automatic browser window reloading when files in the project are changed;
  • With the command $ npm run deployFTP, the final project is uploaded to hosting. The options for sending the project to the desired hosting are specified in the file: gulp/config/ftp.js.

What does WebPack do?

  • In this build, webpack handles JavaScript files;
  • Supports modular script import/export;
  • When importing, there's no need to write the .js file extension, and if importing from the index.js file, you don't need to specify it:
import * as flsFunctions from './modules' // './modules/index.js'
  • With the help of babel, webpack allows you to write code in your favorite ES6+;
  • In "production" mode, during the final build, JS files are minified, and unnecessary comments are removed.

Finale

An added bonus is the gh-pages plugin for deploying the /dist folder to a separate GitHub branch, to beautifully showcase your project on GitHub Pages. For this, specify the link to your gh-pages in the homepage field in package.json:

"homepage": "https://{UserName}.github.io/{NameRepo}",

For any build-related questions, feel free to message me on Telegram.

efin-1's People

Contributors

boyko1396 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.