base_href_rewriter 1.0.1

  • Installing
  • Versions
  • 60

Base Href Rewriter


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


Add the following to your pubspec.yaml.

  base_href_rewriter: any
- 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.

- base_href_rewriter:
    releaseHref: /
    defaultHref: /mysite/web/

1. Depend on it

Add this to your package's pubspec.yaml file:

  base_href_rewriter: "^1.0.1"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:base_href_rewriter/base_href_rewriter.dart';
Version Uploaded Documentation Archive
1.0.1 May 4, 2017 Go to the documentation of base_href_rewriter 1.0.1 Download base_href_rewriter 1.0.1 archive


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1


Describes how popular the package is relative to other packages. [more]
28 / 100
Code health derived from static analysis. [more]
100 / 100
Reflects how tidy and up-to-date the package is. [more]
80 / 100
Overall score:
Weighted score of the above. [more]


Detected platforms: Flutter, other

Primary library: package:base_href_rewriter/base_href_rewriter.dart with components: io, build.


  • Maintain

    Changelog entries help clients to follow the progress in your code.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use base_href_rewriter.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0 <2.0.0
barback ^0.15.2+10 0.15.2+14
html ^0.13.1 0.13.2+2
Transitive dependencies
args 1.3.0
async 2.0.3
charcode 1.1.1
collection 1.14.5
csslib 0.14.1
logging 0.11.3+1
path 1.5.1
pool 1.3.4
source_span 1.4.0
stack_trace 1.9.1
utf 0.9.0+4