-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
<link cdn-href="lib.css">
<link npm-href="lib.css">
<link bower-href="lib.css">
<link domain-href="index.css">
<img cdn-src="img.png" cdn-srcset="img2.png 2x">
<script cdn-src="lib.js"></script>
<script npm-src="lib.css"></script>
<script bower-src="lib.css"></script>
<script domain-src="index.js"></script>(we could also silently support data-* [ex. <img data-cdn-src="img.png">] for spec-compliance)
const options = {
prefixes: {
cdn: 'https://mycdn.com',
npm: 'node_modules',
bower: 'bower_components',
domain: 'https://mysite.com'
}
}
posthtml([ url(options) ]).process(html).then(result => console.log(result.html))compiling to:
<link href="https://mycdn.com/lib.css">
<link href="node_modules/lib.css">
<link href="bower_components/lib.css">
<link href="https://mysite.com/index.css">
<img src="https://mycdn.com/img.png" srcset="https://mycdn.com/img2.png 2x">
<script src="https://mycdn.com/lib.js"></script>
<script src="node_modules/lib.css"></script>
<script src="bower_components/lib.css"></script>
<script src="https://mysite.com/index.js"></script>michael-ciniawsky and Scrummichael-ciniawsky
Metadata
Metadata
Assignees
Labels
No labels