jaspr_builder 0.1.0 copy "jaspr_builder: ^0.1.0" to clipboard
jaspr_builder: ^0.1.0 copied to clipboard

outdated

Polyfill builder for integrating js libraries with jaspr

jaspr_builder #

Polyfill builder for integrating js libraries with jaspr.

How to Use #

First, add jaspr_builder as a dev dependency to your project:

dart pub add jaspr_builder --dev

Next, create a new file named <libname>.web.dart and export any element from the targeted js library:

For example purpose, dart:html is used.

export 'dart:html' show window, Window, Storage;

The export directive must contain an explicit show constraint.

Finally run code generation:

dart run build_runner build

This will generate two files:

  • <libname>.stub.dart contains interface-stubs for all the exported elements
  • <libname>.dart combines the stub and web file with conditional imports

In you project, you should the only import the <libname>.dart file.

0
likes
0
pub points
60%
popularity

Publisher

verified publisherschultek.de

Polyfill builder for integrating js libraries with jaspr

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

analyzer, build, collection, dart_style, path, source_gen

More

Packages that depend on jaspr_builder