Skip to content

Commit

Permalink
Added --canonicalroot CLI option
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Apr 21, 2018
1 parent 3b884ca commit 2a33d5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const yargs = require('yargs');
const subfont = require('./subfont');
const {
root,
canonicalroot,
output,
debug,
'inline-fonts': inlineFonts,
Expand All @@ -22,6 +23,12 @@ const {
type: 'string',
demand: false
})
.options('canonicalroot', {
describe:
'URI root where the site will be deployed. Must be either an absolute or a protocol-relative url.',
type: 'string',
demand: false
})
.options('output', {
alias: 'o',
describe: 'Directory where results should be written to',
Expand Down Expand Up @@ -111,6 +118,7 @@ if (!inPlace && !outRoot) {
try {
const [assetGraph, fontInfo] = await subfont({
rootUrl,
canonicalRootUrl: canonicalroot,
inputUrls,
inlineSubsets: inlineFonts,
inlineCss,
Expand Down
4 changes: 3 additions & 1 deletion lib/subfont.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ const AssetGraph = require('assetgraph');

module.exports = async ({
rootUrl,
canonicalRootUrl,
inputUrls,
inlineSubsets,
inlineCss,
fontDisplay,
recursive
}) => {
const assetGraphConfig = {
root: rootUrl
root: rootUrl,
canonicalRoot: canonicalRootUrl
};

if (!rootUrl.startsWith('file:')) {
Expand Down

0 comments on commit 2a33d5a

Please sign in to comment.