base_href_rewriter 1.0.1

  • README.md
  • Installing
  • Versions
  • 48

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/

Use this package as a library

1. Depend on it

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


dependencies:
  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 flutter 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

Analysis

We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
10 / 100
Health:
Code health derived from static analysis. [more]
97 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70 / 100
Overall score:
Weighted score of the above. [more]
48
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:base_href_rewriter/base_href_rewriter.dart.

Suggestions

  • Maintain CHANGELOG.md.

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

  • Package is getting outdated.

    The package was released 58 weeks ago.

  • 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.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

    Strong-mode analysis of lib/src/transformer.dart gave the following hint:

    line: 10 col: 1
    'barback' is deprecated and shouldn't be used.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0 <2.0.0
barback ^0.15.2+10 0.15.2+16
html ^0.13.1 0.13.3+1
Transitive dependencies
args 1.4.3
async 2.0.7
charcode 1.1.1
collection 1.14.10
csslib 0.14.4
logging 0.11.3+1
path 1.6.1
pool 1.3.5
source_span 1.4.0
stack_trace 1.9.2
utf 0.9.0+4