base_href_rewriter 1.0.1 copy "base_href_rewriter: ^1.0.1" to clipboard
base_href_rewriter: ^1.0.1 copied to clipboard

Dart 1 only

Rewrites Base Href tag in HTML-files.

Base Href Rewriter #

Introduction #

This is a transformer that will rewrite the href attribute of your base element to a configurable string when building your application. It is intended to help solve the issue with changing url paths when switching between development and production environments, such as shown here: Angular Tutorial: Routing - base href

Usage #

Add the following to your pubspec.yaml.

dev_dependencies:
  base_href_rewriter: any
transformers:
- base_href_rewriter:
    releaseHref: /

This will make pub build and pub serve scan your html-files for the base-element and replace the href with the configured string when building for release. You can also set a default href which will then be used for non-release builds.

transformers:
- base_href_rewriter:
    releaseHref: /
    defaultHref: /mysite/web/
0
likes
15
pub points
0%
popularity

Publisher

unverified uploader

Rewrites Base Href tag in HTML-files.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

Dependencies

barback, html

More

Packages that depend on base_href_rewriter