JSPM

  • Created
  • Published
  • Downloads 2762
  • Score
    100M100P100Q126266F

Package Exports

  • @jscutlery/swc-angular-plugin
  • @jscutlery/swc-angular-plugin/wasm32-wasip1/release/swc_angular_plugin.wasm

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jscutlery/swc-angular-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

⚡️ Angular SWC Plugin 🦀

What is this?

SWC (Speedy Web Compiler) is a lightning-fast JavaScript/TypeScript compiler, but it doesn't support Angular even when using JIT (Just-In-Time) compilation because Angular requires some additional transformations:

  • Component.templateUrl => Component.template
  • Component.styleUrls & Component.styleUrl => Component.styles
  • Additional metadata for input(), output(), viewChild(), etc...

That is when this plugin comes in. It is a SWC plugin that adds support for Angular.

Note that this plugin is not a replacement for the Angular compiler, and it won't work without the JIT compiler. This means that while it is suitable for testing, it shouldn't be used to build production applications.

Try it now with your Jest tests

Cf. @jscutlery/swc-angular

Config

[
  '@jscutlery/swc-angular-plugin',
  {
    // this plugin removes styles by default, enable this to transform style urls to style imports
    importStyles?: boolean,
    // add ?inline suffix to style imports for vite support
    styleInlineSuffix?: boolean,
    // add ?raw suffix to template imports for vite support
    templateRawSuffix?: boolean,
  }
]