Coder Social home page Coder Social logo

alex-klock / ng2-fused-seed Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 26 KB

Starter/Seed Project for Angular2 / Angular4 using FuseBox with ng2-fused plugins.

License: MIT License

TypeScript 82.53% CSS 5.85% HTML 6.14% JavaScript 5.48%
angular starter fusebox aot jit ng2 angular2

ng2-fused-seed's Introduction

NG2-FUSED-SEED

Minimilistic Angular2 Seed utilizing the awesome development and build speed of FuseBox with Angular Plugins from ng2-fused! JIT/AOT/HMR/Tree Shaking/Code Splitting/Lazy Route Loading.

Features

  • Uber fast build times thanks to FuseBox.
  • Builds with Angular JIT compilation.
  • Builds with Angular AOT compilation (for enhanced optimization).
  • Utilizes FuseBox's Quantum plugin for minification, dead code elimination, and tree shaking.
  • File watching to automatically rebuild when code is changed.
  • Hot Module Reloading to have your changes automatically reload in the browser.
  • Split vendor/app bundles.
  • Lazy Loaded Routing in both JIT and AOT modes.
  • Automatic Code Splitting based on folder naming convents for modules that should be lazy loaded.
  • Pre/post css processing in JIT or AOT builds (usable with any ViewEncapsulation mode).
    • Seed comes out of the box with PostCSS setup but can easily be swapped.
  • Build flags available to easily modify the build behaviour from the command line.

Setup

  1. Download or clone this repository.
  2. From within the newly cloned folder:
    npm install
  3. Run the development server to compile and open the application.
    npm run start
  4. Browser should automatically open to http://localhost:8080.
  5. Observe lazy loaded route and module at http://localhost:8080/feature.

Executing Unit Tests

  1. Run a build...
    npm run build
    or...
    npm run build:aot
  2. Run the tests...
    npm run test

Build Scripts

JIT Development Server

npm run start

JIT Build (no dev server started)

npm run build

AOT Development Server

npm run start:aot

AOT Build (no dev server started)

npm run build:aot

Production Build

Running the --prod flag executes a production ready build that eliminates dead code, performs tree shaking, and minifies the bundle. You can use the release scripts as well.

npm run release:aot
npm run release:jit

FAQ

Why do you copy source files to build/workspace first?

To allow for multi step processing and mutations on the source. Mostly this was our workaround to get AOT builds to play nicely with other code transformations as well as css pre/post processing.

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.