All Projects → fathyb → Parcel Plugin Angular

fathyb / Parcel Plugin Angular

Licence: mit
Complete Angular support for Parcel

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Parcel Plugin Angular

vox
Vox language compiler. AOT / JIT / Linker. Zero dependencies
Stars: ✭ 288 (+893.1%)
Mutual labels:  jit, aot
Wasm Micro Runtime
WebAssembly Micro Runtime (WAMR)
Stars: ✭ 2,440 (+8313.79%)
Mutual labels:  jit, aot
transonic
🚀 Make your Python code fly at transonic speeds!
Stars: ✭ 93 (+220.69%)
Mutual labels:  jit, aot
Rustc codegen cranelift
Cranelift based backend for rustc
Stars: ✭ 675 (+2227.59%)
Mutual labels:  jit, aot
Awesome Graal
A curated list of awesome resources for Graal, GraalVM, Truffle and related topics
Stars: ✭ 302 (+941.38%)
Mutual labels:  jit, aot
Zetavm
Multi-Language Platform for Dynamic Programming Languages
Stars: ✭ 592 (+1941.38%)
Mutual labels:  jit
Ravi
Ravi is a dialect of Lua, featuring limited optional static typing, JIT and AOT compilers
Stars: ✭ 798 (+2651.72%)
Mutual labels:  jit
Angular2 Express Starter
Angular 8 and Express 👪 ( Heroku ready )
Stars: ✭ 565 (+1848.28%)
Mutual labels:  aot
Mull
Practical mutation testing tool for C and C++
Stars: ✭ 536 (+1748.28%)
Mutual labels:  jit
Hr4r
Example project - "Hot Reloading 4 RequireJS" front-end web applications & some extra code demonstrating hot-reloading for Node.js Express servers
Stars: ✭ 28 (-3.45%)
Mutual labels:  jit
Weather Preactpi
A tiny UI for daily weather forcasts ⛈
Stars: ✭ 13 (-55.17%)
Mutual labels:  parcel
Inkwell
It's a New Kind of Wrapper for Exposing LLVM (Safely)
Stars: ✭ 732 (+2424.14%)
Mutual labels:  jit
Articles Translator
📚Translate the distinct technical blogs. Please star or watch. Welcome to join me.
Stars: ✭ 606 (+1989.66%)
Mutual labels:  parcel
Parcel Plugin Asset Copier
Copy static assets to your bundle dir
Stars: ✭ 25 (-13.79%)
Mutual labels:  parcel
Potion
_why the lucky stiff's little language (the official repo... until _why returns)
Stars: ✭ 586 (+1920.69%)
Mutual labels:  jit
Angular Parcel Boilerplate
Parcel template for using Angular.io
Stars: ✭ 15 (-48.28%)
Mutual labels:  parcel
Moarvm
A VM with adaptive optimization and JIT compilation, built for Rakudo
Stars: ✭ 537 (+1751.72%)
Mutual labels:  jit
Blend2d
2D Vector Graphics Engine Powered by a JIT Compiler
Stars: ✭ 859 (+2862.07%)
Mutual labels:  jit
Revise.jl
Automatically update function definitions in a running Julia session
Stars: ✭ 705 (+2331.03%)
Mutual labels:  jit
Universal
Seed project for Angular Universal apps featuring Server-Side Rendering (SSR), Webpack, CLI scaffolding, dev/prod modes, AoT compilation, HMR, SCSS compilation, lazy loading, config, cache, i18n, SEO, and TSLint/codelyzer
Stars: ✭ 669 (+2206.9%)
Mutual labels:  aot

parcel-plugin-angular

Complete Angular support for Parcel and TypeScript.

screenshot

Features

  • parcel-plugin-typescript features
  • AOT compilation : using the official Angular compiler for smaller and faster applications.
  • Lazy Loading : the plugin automagically splits your Angular modules in multiple JavaScript files with Parcel when you use lazy routes.
  • Template and style parsing : your templates and style are processed by Parcel to find and replace resources.
  • Transformations (based on angular/angular-cli transformers) :
    • It removes all your Angular decorators in AOT mode for smaller bundles
    • It replaces JIT bootstrap code with AOT when it's used. You can keep one main file using the @angular/platform-browser-dynamic module, see Entry file

Prerequisites

  • @angular/compiler and @angular/compiler-cli should be installed
  • parcel-plugin-typescript should not be installed

Installation

yarn add parcel-plugin-angular --dev

or

npm install parcel-plugin-angular --save-dev

Configuration

You can pass a parcelAngularOptions object in your tsconfig.json, here are the defaults :

{
  "compilerOptions": { ... },
  // the plugin options
  "parcelAngularOptions": {
    // What compiler should we use when watching or serving
    "watch": "jit",

    // What compiler should we use when building (parcel build)
    "build": "aot"
  }
}

Entry file

To make it easy to switch between JIT and AOT mode we automatically translate your JIT bootstrap code to AOT if you are using the AOT compiler.

import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'
import {enableProdMode} from '@angular/core'
import {AppModule} from './app/app.module'

if(process.env.NODE_ENV === 'production') {
  enableProdMode()
}

platformBrowserDynamic().bootstrapModule(AppModule)

will be transformed to :

import {platformBrowser} from '@angular/platform-browser'
import {enableProdMode} from '@angular/core'
import {AppModuleNgFactory} from './app/app.module.ngfactory'

if(process.env.NODE_ENV === 'production') {
  enableProdMode()
}

platformBrowser().bootstrapModuleFactory(AppModuleNgFactory)

Known issues

  • AOT mode is highly experimental
  • Lazy-loading does not work in JIT
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].