GithubHelp home page GithubHelp logo

isabella232 / federalist-build-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 18f/federalist-build-js

0.0 0.0 0.0 36 KB

DEPRECATED - A test to build production JavaScript on Federalist

License: Creative Commons Zero v1.0 Universal

Ruby 0.71% HTML 0.95% JavaScript 96.10% Shell 2.25%

federalist-build-js's Introduction

DEPRECATED

Build JS on Federalist

This is a standalone test of an idea that Brian and I cooked up for EITI, in which we use a Jekyll plugin to fire off a production build (using WebPack in this case, but it could be anything) of our JavaScript in the Federalist build container. That way, we can keep minified JS out of version control (which inevitably causes merge conflicts, as in College Scorecard) and have production JS built on specific branches.

Here's how it works:

  1. Our Jekyll plugin, _plugins/build.rb, compares the BRANCH environment variable (set by Federalist during a build) to a list of known "production" branches.
  2. If the branch is in our production list, we set ENV['NODE_ENV'] = 'production' and build the JavaScript with npm install && npm run build.
  3. Our npm build script calls webpack.
  4. Our webpack config conditionally uglifies the JavaScript if process.env.NODE_ENV === 'production'.

You can see the results built by Federalist here.

federalist-build-js's People

Contributors

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