Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

taisph/base-href-rewriter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages