Skip to content

Commit

Permalink
absolute url check + root relative url documentation in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aruntk committed Aug 9, 2017
1 parent 48b154d commit 9bb2b83
Show file tree
Hide file tree
Showing 3 changed files with 2,280 additions and 338 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,28 @@ loader: 'ts-loader!wc-loader'
```js
loader: 'coffee-loader!wc-loader'
```

### Options

#### 'Root-relative' URLs

For urls that start with a `/`, the default behavior is to not translate them. You'll get a file not found error in the browser. (/path = example.com/path for the browser)
If a `root` query parameter is set, however, it will be prepended to the url
and then translated.

``` html
<!-- file.html -->
<img src="/image.jpg">
```
```js
// webpack config

{
test: /\.html$/,
loader: 'babel-loader!wc-loader?root=/',
},

```
#### Minify html

```js
Expand All @@ -114,6 +134,7 @@ Use custom options - by config setting `minifierOptions`

Refer https://github.com/kangax/html-minifier for more info


### Like it?

:star: this repo
Expand All @@ -127,3 +148,4 @@ Raise an issue!

MIT. Check [licence](licence) file.


0 comments on commit 9bb2b83

Please sign in to comment.