Skip to content

Commit fcc014a

Browse files
committed
fix: use full path for jsdelivr when running dumber in browser
1 parent 64c68eb commit fcc014a

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/package-file-reader/jsDelivr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const {ext} = require('dumber-module-loader/dist/id-utils');
33
const {encode} = require('base64-arraybuffer');
44

55
// use in browser only
6-
let prefix = '//cdn.jsdelivr.net/npm/';
6+
let prefix = 'https://cdn.jsdelivr.net/npm/';
77

88
function fetchContent(fetchApi, fp) {
99
return fetchApi(prefix + fp)

test/package-file-reader/jsDelivr.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ test('jsDelivrNpmPackageFileReader returns fileRead func for existing package',
6161
return fileRead('package.json')
6262
.then(
6363
file => {
64-
t.equal(file.path, '//cdn.jsdelivr.net/npm/foo@1.0.1/package.json');
64+
t.equal(file.path, 'https://cdn.jsdelivr.net/npm/foo@1.0.1/package.json');
6565
const info = JSON.parse(file.contents);
6666
t.equal(info.name, 'foo');
6767
t.equal(info.version, '1.0.1');
@@ -80,7 +80,7 @@ test('jsDelivrNpmPackageFileReader returns fileRead func for fixed package versi
8080
return fileRead('package.json')
8181
.then(
8282
file => {
83-
t.equal(file.path, '//cdn.jsdelivr.net/npm/bar@2.0.0-rc1/package.json');
83+
t.equal(file.path, 'https://cdn.jsdelivr.net/npm/bar@2.0.0-rc1/package.json');
8484
const info = JSON.parse(file.contents);
8585
t.equal(info.name, 'bar');
8686
t.equal(info.version, '2.0.0-rc1');
@@ -100,7 +100,7 @@ test('jsDelivrNpmPackageFileReader returns fileRead func for alias package', t =
100100
return fileRead('package.json')
101101
.then(
102102
file => {
103-
t.equal(file.path, '//cdn.jsdelivr.net/npm/foo@1.0.1/package.json');
103+
t.equal(file.path, 'https://cdn.jsdelivr.net/npm/foo@1.0.1/package.json');
104104
const info = JSON.parse(file.contents);
105105
t.equal(info.name, 'bar');
106106
t.equal(info.version, '1.0.1');
@@ -133,7 +133,7 @@ test('jsDelivrNpmPackageFileReader returns fileRead func for existing scoped pac
133133
return fileRead('package.json')
134134
.then(
135135
file => {
136-
t.equal(file.path, '//cdn.jsdelivr.net/npm/@scoped/pkg@1.0.0/package.json');
136+
t.equal(file.path, 'https://cdn.jsdelivr.net/npm/@scoped/pkg@1.0.0/package.json');
137137
const info = JSON.parse(file.contents);
138138
t.equal(info.name, '@scoped/pkg');
139139
t.equal(info.version, '1.0.0');

0 commit comments

Comments
 (0)