Giter VIP home page Giter VIP logo

parcel-starter-modern's Introduction

๐Ÿ“ฆ parcel-starter-modern

A modern Parcel starter aiming for high productivity with mostly vanilla techniques.

๐Ÿš€ Getting started

  • Clone this project (e.g. with git clone)
  • Run yarn or npm install inside the root directory of the cloned project to install all the required dependencies
  • Start a development server by yarn start or npm run start

๐Ÿ  Modern ECMAScript transforms

Use next generation JavaScript today with the help of Babel and its env preset, configurable to support the browsers of your choice.

๐Ÿ’ก Stay up to date with the latest ECMAScript proposals and utilize them without fear from lack of browser support.

๐Ÿ’… Enhanced style management

SCSS, a superset of CSS can be used for styling pages. The usage of Sass-specific extensions is optional, as every valid CSS stylesheet is a valid SCSS file with the same meaning.

The default style of browsers is normalized by modern-normalize.

Stylesheets are processed by PostCSS, providing proper browser support for modern CSS syntax through its env preset and Autoprefixer.

โœจ Superior developer experience

Automatic code formatting

Prettier is an opinionated code formatter aiming to provide codebase consistency when multiple developers work on the same project. The main reason behind adopting Prettier is to stop all the on-going debates over coding styles.

Linting

Linters are tools that analyze source code to flag programming errors, bugs, stylistic errors, and suspicious constructs.

Construct flexible layouts with ease

Bulma is a modular, mobile-first CSS framework. It can be used along with the HTML viewport meta tag to build responsive websites with ease.

๐Ÿ› ๏ธ Configurable with reasonable defaults

Override the list of targeted browsers

By default, Parcel targets modern browsers. This behavior can be overrided in numerous ways, e.g. by a .browserslistrc config file:

> 1%
last 2 versions

Opt-in templating support

Building a multi-page website may introduce unwanted redundancy to your project. In this case, consider using an HTML templating solution.

๐Ÿ’ก Pages with similar layout should rely on a single template instead of duplicated code.

Example

To demonstrate the concept of templating, a "vanilla-like" solution will be used.

Firstly, install posthtml-extend (or the templating library of your choice):

yarn add posthtml-extend

After that, add a .posthtmlrc file to the root of your project, as instructed by the official Parcel docs:

{
  "plugins": {
    "posthtml-extend": {
      "root": "./src/layouts"
    }
  }
}

Finally, create a new layout and a page based on it.

src/layouts/index.html:

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8" />

  <title>
    <block name="title"> | Website title</block>
  </title>
</head>

<body>
  <main>
    <block name="main" />
  </main>

  <footer>
    <block name="footer">Footer content</block>
  </footer>
</body>

</html>

src/pages/index.html:

<!-- The line below refers to "src/layouts/index.html", as specified in ".posthtmlrc" -->
<extends src="index.html">
  <block name="title" type="prepend">Page title</block>

  <block name="main">
    <h1>Hello, templating!</h1>
    <p>Goodbye, code duplication!</p>
  </block>

  <block name="footer" type="append"> โ€“ Author name</block>
</extends>

The result should look as follows:

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8" />

  <title>
    Page title | Website title
  </title>
</head>

<body>
  <main>
    <h1>Hello, templating!</h1>
    <p>Goodbye, code duplication!</p>
  </main>

  <footer>
    <block name="footer">Footer content โ€“ Author name</block>
  </footer>
</body>

</html>

parcel-starter-modern's People

Contributors

kripod avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.