Eleventy Webpack screenshot

Eleventy Webpack

Author Avatar Theme by Clenemt
Updated: 12 Jan 2021
145 Stars

A barebone Eleventy and Webpack boilerplate

Categories

Overview:

The eleventy-webpack template is a barebone Eleventy and webpack template that allows for fast and efficient build processes. It includes various features such as support for ES6 JavaScript with Babel, Sass and PostCSS for styling, responsive images and cached remote images, SEO metadata and Open Graph tags, SVG icon sprite generation, safe external links, useful shortcodes and filters, and a Neat error overlay. The template is optimized for production with source maps, headers, and minified code.

Features:

  • Barebone 11ty: A minimalistic setup for Eleventy.
  • Fast build with per env configs: The build process is fast and efficient thanks to the use of Babel-env, PostCSS-preset-env, and webpack.
  • JS (ES6, Babel, Polyfills): Supports modern ES6 JavaScript syntax with Babel and polyfills for browser compatibility.
  • CSS (Sass, PostCSS, Autoprefixer): Includes support for Sass, PostCSS, and Autoprefixer for easy styling.
  • Optimized for production: The template is optimized for production with features like source maps, headers, and minified code.
  • Responsive images and cached remote images: Supports responsive image handling and caching of remote images using the @11ty/eleventy-img package.
  • SVG icon sprite generation: Bundles SVG files into a symbol sprite file and provides a shortcode for easy usage.
  • SEO metadata and Open Graph tags: Includes built-in support for generating SEO metadata and Open Graph tags.
  • Safe external links: Adds security measures to external links to prevent vulnerabilities.
  • Useful shortcodes and filters: Provides a collection of useful shortcodes and filters, including those for handling dates, markdown, sprite icons, and responsive images.
  • Neat error overlay: Includes a neat error overlay using the eleventy-plugin-error-overlay package.
  • Prettier for formatting: Includes Prettier for code formatting.

Installation:

To get started with eleventy-webpack, follow these steps:

  1. Clone or download the template from the GitHub repository.
  2. Open a terminal and navigate to the project directory.
  3. Run the following command to install the dependencies:
npm install
  1. Once the dependencies are installed, you can use the following commands:
  • npm run start: Runs the website on http://localhost:8080 for development.
  • npm run build: Builds the production website inside the _site directory.
  • npm run format: Runs Prettier on all files except the _site directory.
  • npm run analyze: Outputs information on the bundle size.
  1. Ensure that you are using the correct version of Node.js for the template.

Summary:

The eleventy-webpack template is a minimalistic and powerful setup for building static websites using Eleventy and webpack. It provides a range of features such as modern JavaScript support, styling with Sass and PostCSS, responsive image handling, SEO metadata generation, and more. The template is easy to install and use, with clear documentation on how to run the development server, build the production website, and analyze bundle sizes. Overall, eleventy-webpack is a great choice for developers looking to build efficient and optimized static websites.