Giter VIP home page Giter VIP logo

eleventy-postcss-issue-demo's Introduction

Reproduction for issue 11ty/eleventy#3007

To run:

npm i
npm start

Visit http://localhost:8080. The text "This is a test." should have a blue background, but it doesn't the first time the Dev Server is run. For more detail on the issue, see the full issue description.

Implementation notes

This repo demonstrates the use of Eleventy to build a static website with a CSS stylesheet generated by PostCSS CLI. In development (the start script defined in package.json for npm start), PostCSS CLI waits for 5 seconds to simulate a build that is not complete before Eleventy Dev Server attempts to copy the output to the _site directory.

    "start": "npm run start:eleventy & npm run start:postcss",
    "start:eleventy": "eleventy --serve --incremental",
    "start:postcss": "sleep 5 && postcss styles/styles.css --dir _tmp --watch --verbose",
  eleventyConfig.addPassthroughCopy({
    "_tmp/styles.css": "assets/styles/styles.css",
  });

Note: Rather than PostCSS CLI outputting the stylesheet directly into the _site directory, which would not benefit from Eleventy Dev Server's live reloading, PostCSS CLI outputs the file to _tmp, and then Eleventy should copy it from there into the _site directory and live-reload it in the browser whenever it changes.

eleventy-postcss-issue-demo's People

Contributors

sentience avatar

Watchers

 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.