Commit d5770069 authored by Robert Knight's avatar Robert Knight

Make the asset root URL relative to the root of the package

When serving the package's contents via an npm CDN such as unpkg.com, it
will be more convenient if the asset root URL provided by the service
refers to the root of the package rather than the root of the `build/`
dir.
parent 8bbf9b99
......@@ -21,7 +21,7 @@ function injectScript(doc, src) {
function injectAssets(doc, config, assets) {
assets.forEach(function (path) {
var url = config.assetRoot + config.manifest[path];
var url = config.assetRoot + 'build/' + config.manifest[path];
if (url.match(/\.css/)) {
injectStylesheet(doc, url);
} else {
......
......@@ -77,7 +77,7 @@ describe('bootstrap', function () {
'styles/inject.1234.css',
'styles/pdfjs-overrides.1234.css',
].map(function (url) {
return 'https://marginal.ly/client/' + url;
return 'https://marginal.ly/client/build/' + url;
});
assert.deepEqual(findAssets(iframe.contentDocument), expectedAssets);
......@@ -131,7 +131,7 @@ describe('bootstrap', function () {
'styles/icomoon.1234.css',
'styles/katex.min.1234.css',
].map(function (url) {
return 'https://marginal.ly/client/' + url;
return 'https://marginal.ly/client/build/' + url;
});
assert.deepEqual(findAssets(iframe.contentDocument), expectedAssets);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment