@parcel/utils 2.0.0-nightly.137 → 2.0.0-nightly.1373

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/.eslintrc.js +6 -6
  2. package/lib/index.js +37566 -307
  3. package/lib/index.js.map +1 -0
  4. package/package.json +45 -20
  5. package/src/BitSet.js +126 -0
  6. package/src/DefaultMap.js +1 -1
  7. package/src/PromiseQueue.js +16 -12
  8. package/src/alternatives.js +145 -0
  9. package/src/ansi-html.js +2 -2
  10. package/src/blob.js +2 -1
  11. package/src/bundle-url.js +1 -1
  12. package/src/collection.js +35 -15
  13. package/src/config.js +132 -45
  14. package/src/countLines.js +5 -2
  15. package/src/debounce.js +1 -1
  16. package/src/dependency-location.js +11 -6
  17. package/src/generateBuildMetrics.js +158 -0
  18. package/src/generateCertificate.js +1 -1
  19. package/src/getCertificate.js +1 -1
  20. package/src/getExisting.js +1 -4
  21. package/src/getModuleParts.js +23 -0
  22. package/src/getRootDir.js +1 -2
  23. package/src/glob.js +51 -10
  24. package/src/hash.js +49 -0
  25. package/src/http-server.js +29 -19
  26. package/src/index.js +69 -21
  27. package/src/is-url.js +1 -1
  28. package/src/isDirectoryInside.js +11 -0
  29. package/src/openInBrowser.js +64 -0
  30. package/src/path.js +38 -6
  31. package/src/prettyDiagnostic.js +74 -24
  32. package/src/progress-message.js +22 -0
  33. package/src/relativeBundlePath.js +8 -13
  34. package/src/replaceBundleReferences.js +85 -41
  35. package/src/schema.js +100 -44
  36. package/src/shared-buffer.js +23 -0
  37. package/src/sourcemap.js +138 -0
  38. package/src/stream.js +31 -1
  39. package/src/urlJoin.js +3 -1
  40. package/test/BitSet.test.js +119 -0
  41. package/test/DefaultMap.test.js +7 -4
  42. package/test/collection.test.js +13 -1
  43. package/test/config.test.js +98 -0
  44. package/test/input/config/.testrc +3 -0
  45. package/test/input/config/config.cjs +3 -0
  46. package/test/input/config/config.js +3 -0
  47. package/test/input/config/config.json +3 -0
  48. package/test/input/config/empty.json +0 -0
  49. package/test/input/config/empty.toml +0 -0
  50. package/test/input/sourcemap/referenced-min.js +2 -0
  51. package/test/input/sourcemap/referenced-min.js.map +6 -0
  52. package/test/input/sourcemap/source-root.js +2 -0
  53. package/test/input/sourcemap/source-root.js.map +7 -0
  54. package/test/replaceBundleReferences.test.js +268 -0
  55. package/test/sourcemap.test.js +207 -0
  56. package/test/throttle.test.js +1 -2
  57. package/test/urlJoin.test.js +37 -0
  58. package/lib/DefaultMap.js +0 -64
  59. package/lib/Deferred.js +0 -26
  60. package/lib/PromiseQueue.js +0 -133
  61. package/lib/TapStream.js +0 -41
  62. package/lib/ansi-html.js +0 -16
  63. package/lib/blob.js +0 -31
  64. package/lib/bundle-url.js +0 -43
  65. package/lib/collection.js +0 -62
  66. package/lib/config.js +0 -88
  67. package/lib/countLines.js +0 -18
  68. package/lib/debounce.js +0 -20
  69. package/lib/dependency-location.js +0 -21
  70. package/lib/escape-html.js +0 -24
  71. package/lib/generateBundleReport.js +0 -38
  72. package/lib/generateCertificate.js +0 -124
  73. package/lib/getCertificate.js +0 -19
  74. package/lib/getExisting.js +0 -23
  75. package/lib/getRootDir.js +0 -55
  76. package/lib/glob.js +0 -76
  77. package/lib/http-server.js +0 -64
  78. package/lib/is-url.js +0 -17
  79. package/lib/loadSourceMapUrl.js +0 -33
  80. package/lib/md5.js +0 -35
  81. package/lib/objectHash.js +0 -26
  82. package/lib/parseCSSImport.js +0 -16
  83. package/lib/path.js +0 -22
  84. package/lib/prettifyTime.js +0 -10
  85. package/lib/prettyDiagnostic.js +0 -57
  86. package/lib/promisify.js +0 -13
  87. package/lib/relativeBundlePath.js +0 -24
  88. package/lib/relativeUrl.js +0 -16
  89. package/lib/replaceBundleReferences.js +0 -151
  90. package/lib/resolve.js +0 -93
  91. package/lib/schema.js +0 -320
  92. package/lib/serializeObject.js +0 -28
  93. package/lib/stream.js +0 -51
  94. package/lib/throttle.js +0 -16
  95. package/lib/urlJoin.js +0 -27
  96. package/src/.babelrc +0 -3
  97. package/src/generateBundleReport.js +0 -51
  98. package/src/loadSourceMapUrl.js +0 -33
  99. package/src/md5.js +0 -44
  100. package/src/promisify.js +0 -13
  101. package/src/resolve.js +0 -135
  102. package/src/serializeObject.js +0 -22
  103. package/test/input/sourcemap/referenced.js +0 -7
  104. package/test/loadSourceMapUrl.test.js +0 -37
package/src/urlJoin.js CHANGED
@@ -9,7 +9,9 @@ import path from 'path';
9
9
  */
10
10
  export default function urlJoin(publicURL: string, assetPath: string): string {
11
11
  const url = URL.parse(publicURL, false, true);
12
- const assetUrl = URL.parse(assetPath);
12
+ // Leading / ensures that paths with colons are not parsed as a protocol.
13
+ let p = assetPath.startsWith('/') ? assetPath : '/' + assetPath;
14
+ const assetUrl = URL.parse(p);
13
15
  url.pathname = path.posix.join(url.pathname, assetUrl.pathname);
14
16
  url.search = assetUrl.search;
15
17
  url.hash = assetUrl.hash;
@@ -0,0 +1,119 @@
1
+ // @flow strict-local
2
+
3
+ import assert from 'assert';
4
+ import {BitSet} from '../src/BitSet';
5
+
6
+ function assertValues<Item>(set: BitSet<Item>, values: Array<Item>) {
7
+ let setValues = set.values();
8
+
9
+ for (let value of values) {
10
+ assert(set.has(value), 'Set.has returned false');
11
+ assert(
12
+ setValues.some(v => v === value),
13
+ 'Set values is missing value',
14
+ );
15
+ }
16
+
17
+ assert(
18
+ setValues.length === values.length,
19
+ `Expected ${values.length} values but got ${setValues.length}`,
20
+ );
21
+ }
22
+
23
+ describe('BitSet', () => {
24
+ it('cloneEmpty should return an empty set', () => {
25
+ let set1 = BitSet.from([1, 2, 3, 4, 5]);
26
+ set1.add(1);
27
+ set1.add(3);
28
+
29
+ let set2 = set1.cloneEmpty();
30
+
31
+ assertValues(set2, []);
32
+ });
33
+
34
+ it('clone should return a set with the same values', () => {
35
+ let set1 = BitSet.from([1, 2, 3, 4, 5]);
36
+ set1.add(1);
37
+ set1.add(3);
38
+
39
+ let set2 = set1.clone();
40
+
41
+ assertValues(set2, [1, 3]);
42
+ });
43
+
44
+ it('clear should remove all values from the set', () => {
45
+ let set1 = BitSet.from([1, 2, 3, 4, 5]);
46
+ set1.add(1);
47
+ set1.add(3);
48
+
49
+ set1.clear();
50
+
51
+ assertValues(set1, []);
52
+ });
53
+
54
+ it('delete should remove values from the set', () => {
55
+ let set1 = BitSet.from([1, 2, 3, 4, 5]);
56
+ set1.add(1);
57
+ set1.add(3);
58
+ set1.add(5);
59
+
60
+ set1.delete(3);
61
+
62
+ assertValues(set1, [1, 5]);
63
+ });
64
+
65
+ it('should intersect with another BitSet', () => {
66
+ let set1 = BitSet.from([1, 2, 3, 4, 5]);
67
+ set1.add(1);
68
+ set1.add(3);
69
+
70
+ let set2 = set1.cloneEmpty();
71
+ set2.add(3);
72
+ set2.add(5);
73
+
74
+ set1.intersect(set2);
75
+ assertValues(set1, [3]);
76
+ });
77
+
78
+ it('should union with another BitSet', () => {
79
+ let set1 = BitSet.from([1, 2, 3, 4, 5]);
80
+ set1.add(1);
81
+ set1.add(3);
82
+
83
+ let set2 = set1.cloneEmpty();
84
+ set2.add(3);
85
+ set2.add(5);
86
+
87
+ set1.union(set2);
88
+ assertValues(set1, [1, 3, 5]);
89
+ });
90
+
91
+ it('BitSet.union should create a new BitSet with the union', () => {
92
+ let set1 = BitSet.from([1, 2, 3, 4, 5]);
93
+ set1.add(1);
94
+ set1.add(3);
95
+
96
+ let set2 = set1.cloneEmpty();
97
+ set2.add(3);
98
+ set2.add(5);
99
+
100
+ let set3 = BitSet.union(set1, set2);
101
+ assertValues(set1, [1, 3]);
102
+ assertValues(set2, [3, 5]);
103
+ assertValues(set3, [1, 3, 5]);
104
+ });
105
+
106
+ it('returns an array of all values', () => {
107
+ let set = BitSet.from([1, 2, 3, 4]);
108
+ set.add(1);
109
+ set.add(3);
110
+
111
+ assertValues(set, [3, 1]);
112
+ });
113
+
114
+ it('should return an error if a new item is added', () => {
115
+ let set = BitSet.from([1, 2, 3, 4]);
116
+
117
+ assert.throws(() => set.add(5), /Item is missing from BitSet/);
118
+ });
119
+ });
@@ -5,10 +5,13 @@ import {DefaultMap} from '../src/DefaultMap';
5
5
 
6
6
  describe('DefaultMap', () => {
7
7
  it('constructs with entries just like Map', () => {
8
- let map = new DefaultMap(k => k, [
9
- [1, 3],
10
- [2, 27],
11
- ]);
8
+ let map = new DefaultMap(
9
+ k => k,
10
+ [
11
+ [1, 3],
12
+ [2, 27],
13
+ ],
14
+ );
12
15
  assert.equal(map.get(1), 3);
13
16
  assert.deepEqual(Array.from(map.entries()), [
14
17
  [1, 3],
@@ -1,7 +1,11 @@
1
1
  // @flow
2
2
 
3
3
  import assert from 'assert';
4
- import {objectSortedEntries, objectSortedEntriesDeep} from '../src/collection';
4
+ import {
5
+ objectSortedEntries,
6
+ objectSortedEntriesDeep,
7
+ setDifference,
8
+ } from '../src/collection';
5
9
 
6
10
  describe('objectSortedEntries', () => {
7
11
  it('returns a sorted list of key/value tuples', () => {
@@ -38,3 +42,11 @@ describe('objectSortedEntriesDeep', () => {
38
42
  );
39
43
  });
40
44
  });
45
+ describe('setDifference', () => {
46
+ it('returns a setDifference of two sets of T type', () => {
47
+ assert.deepEqual(
48
+ setDifference(new Set([1, 2, 3]), new Set([3, 4, 5])),
49
+ new Set([1, 2, 4, 5]),
50
+ );
51
+ });
52
+ });
@@ -0,0 +1,98 @@
1
+ // @flow strict-local
2
+
3
+ import assert from 'assert';
4
+ import {loadConfig} from '../src/config';
5
+ import {inputFS as fs} from '@parcel/test-utils';
6
+ import path from 'path';
7
+
8
+ describe('loadConfig', () => {
9
+ it('load config with json', async () => {
10
+ assert.deepEqual(
11
+ (
12
+ await loadConfig(
13
+ fs,
14
+ path.join(__dirname, './input/config/config.json'),
15
+ ['config.json'],
16
+ path.join(__dirname, './input/config/'),
17
+ )
18
+ )?.config,
19
+ {
20
+ hoge: 'fuga',
21
+ },
22
+ );
23
+ });
24
+
25
+ it('should throw error with empty string json', async () => {
26
+ // $FlowFixMe[prop-missing]
27
+ await assert.rejects(async () => {
28
+ await loadConfig(
29
+ fs,
30
+ path.join(__dirname, './input/config/empty.json'),
31
+ ['empty.json'],
32
+ path.join(__dirname, './input/config/'),
33
+ );
34
+ });
35
+ });
36
+
37
+ it('should load with empty string config toml', async () => {
38
+ assert.deepEqual(
39
+ (
40
+ await loadConfig(
41
+ fs,
42
+ path.join(__dirname, './input/config/empty.toml'),
43
+ ['empty.toml'],
44
+ path.join(__dirname, './input/config/'),
45
+ )
46
+ )?.config,
47
+ {},
48
+ );
49
+ });
50
+
51
+ it('should load with js', async () => {
52
+ assert.deepEqual(
53
+ (
54
+ await loadConfig(
55
+ fs,
56
+ path.join(__dirname, './input/config/config.js'),
57
+ ['config.js'],
58
+ path.join(__dirname, './input/config/'),
59
+ )
60
+ )?.config,
61
+ {
62
+ hoge: 'fuga',
63
+ },
64
+ );
65
+ });
66
+
67
+ it('should load with cjs', async () => {
68
+ assert.deepEqual(
69
+ (
70
+ await loadConfig(
71
+ fs,
72
+ path.join(__dirname, './input/config/config.cjs'),
73
+ ['config.cjs'],
74
+ path.join(__dirname, './input/config/'),
75
+ )
76
+ )?.config,
77
+ {
78
+ hoge: 'fuga',
79
+ },
80
+ );
81
+ });
82
+
83
+ it('should load without an extension as json', async () => {
84
+ assert.deepEqual(
85
+ (
86
+ await loadConfig(
87
+ fs,
88
+ path.join(__dirname, './input/config/.testrc'),
89
+ ['.testrc'],
90
+ path.join(__dirname, './input/config/'),
91
+ )
92
+ )?.config,
93
+ {
94
+ hoge: 'fuga',
95
+ },
96
+ );
97
+ });
98
+ });
@@ -0,0 +1,3 @@
1
+ {
2
+ "hoge": "fuga"
3
+ }
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ hoge: 'fuga',
3
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ hoge: 'fuga',
3
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+ "hoge": "fuga"
3
+ }
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ function hello(){var l="Hello",o="world";console.log(l+" "+o+"!")}hello();
2
+ //# sourceMappingURL=file://referenced-min.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version":3,
3
+ "sources":["./referenced.js"],
4
+ "names":["hello","l","o","console","log"],
5
+ "mappings":"AAAA,SAASA,QACP,IAAIC,EAAI,QACNC,EAAI,QACNC,QAAQC,IAAIH,EAAI,IAAMC,EAAI,KAE5BF"
6
+ }
@@ -0,0 +1,2 @@
1
+ function hello(){var l="Hello",o="world";console.log(l+" "+o+"!")}hello();
2
+ //# sourceMappingURL=source-root.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version":3,
3
+ "sourceRoot": "../",
4
+ "sources":["./source.js"],
5
+ "names":["hello","l","o","console","log"],
6
+ "mappings":"AAAA,SAASA,QACP,IAAIC,EAAI,QACNC,EAAI,QACNC,QAAQC,IAAIH,EAAI,IAAMC,EAAI,KAE5BF"
7
+ }
@@ -0,0 +1,268 @@
1
+ // @flow strict-local
2
+
3
+ import type {NamedBundle, Dependency} from '@parcel/types';
4
+
5
+ import assert from 'assert';
6
+ import {getURLReplacement} from '../src/replaceBundleReferences';
7
+
8
+ describe('replace bundle references', () => {
9
+ it('Query params and named pipeline, relative', () => {
10
+ // $FlowFixMe
11
+ let fromBundle: NamedBundle = {
12
+ filePath: '/user/dist/reformat.html',
13
+ name: 'reformat.html',
14
+ // $FlowFixMe
15
+ target: {
16
+ distDir: '/user/dist',
17
+ publicUrl: '/',
18
+ },
19
+ };
20
+
21
+ // $FlowFixMe
22
+ let toBundle: NamedBundle = {
23
+ filePath:
24
+ '/user/dist/image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
25
+ name: 'image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
26
+ // $FlowFixMe
27
+ target: {
28
+ distDir: '/user/dist',
29
+ publicUrl: '/',
30
+ },
31
+ };
32
+
33
+ // $FlowFixMe
34
+ let dependency: Dependency = {
35
+ id: '074b36596e3147e900a8ad17ceb5c90b',
36
+ specifier: 'url:./image.jpg?as=webp',
37
+ specifierType: 'esm',
38
+ };
39
+
40
+ let result = getURLReplacement({
41
+ dependency,
42
+ fromBundle,
43
+ toBundle,
44
+ relative: true,
45
+ });
46
+
47
+ assert.equal(
48
+ result.to,
49
+ 'image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
50
+ );
51
+ assert.equal(result.from, '074b36596e3147e900a8ad17ceb5c90b');
52
+ });
53
+
54
+ it('Query params and named pipeline, absolute', () => {
55
+ // $FlowFixMe
56
+ let fromBundle: NamedBundle = {
57
+ filePath: '/user/dist/reformat.html',
58
+ name: 'reformat.html',
59
+ // $FlowFixMe
60
+ target: {
61
+ distDir: '/user/dist',
62
+ publicUrl: '/',
63
+ },
64
+ };
65
+
66
+ // $FlowFixMe
67
+ let toBundle: NamedBundle = {
68
+ filePath:
69
+ '/user/dist/image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
70
+ name: 'image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
71
+ // $FlowFixMe
72
+ target: {
73
+ distDir: '/user/dist',
74
+ publicUrl: '/',
75
+ },
76
+ };
77
+
78
+ // $FlowFixMe
79
+ let dependency: Dependency = {
80
+ id: '074b36596e3147e900a8ad17ceb5c90b',
81
+ specifier: 'url:./image.jpg?as=webp',
82
+ specifierType: 'esm',
83
+ };
84
+
85
+ let result = getURLReplacement({
86
+ dependency,
87
+ fromBundle,
88
+ toBundle,
89
+ relative: false,
90
+ });
91
+
92
+ assert.equal(
93
+ result.to,
94
+ '/image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
95
+ );
96
+ assert.equal(result.from, '074b36596e3147e900a8ad17ceb5c90b');
97
+ });
98
+
99
+ it('Custom Public URL', () => {
100
+ // $FlowFixMe
101
+ let fromBundle: NamedBundle = {
102
+ filePath: '/user/dist/reformat.html',
103
+ name: 'reformat.html',
104
+ // $FlowFixMe
105
+ target: {
106
+ distDir: '/user/dist',
107
+ publicUrl: 'https://test.com/static',
108
+ },
109
+ };
110
+
111
+ // $FlowFixMe
112
+ let toBundle: NamedBundle = {
113
+ filePath:
114
+ '/user/dist/image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
115
+ name: 'image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
116
+ // $FlowFixMe
117
+ target: {
118
+ distDir: '/user/dist',
119
+ publicUrl: 'https://test.com/static',
120
+ },
121
+ };
122
+
123
+ // $FlowFixMe
124
+ let dependency: Dependency = {
125
+ id: '074b36596e314797845a8ad17ceb5c9b',
126
+ specifier: './image.jpg',
127
+ specifierType: 'esm',
128
+ };
129
+
130
+ let result = getURLReplacement({
131
+ dependency,
132
+ fromBundle,
133
+ toBundle,
134
+ relative: false,
135
+ });
136
+
137
+ assert.equal(
138
+ result.to,
139
+ 'https://test.com/static/image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
140
+ );
141
+ assert.equal(result.from, '074b36596e314797845a8ad17ceb5c9b');
142
+ });
143
+
144
+ it('Relative with folders in between', () => {
145
+ // $FlowFixMe
146
+ let fromBundle: NamedBundle = {
147
+ filePath: '/user/dist/reformat.html',
148
+ name: 'reformat.html',
149
+ // $FlowFixMe
150
+ target: {
151
+ distDir: '/user/dist',
152
+ publicUrl: 'https://test.com/static',
153
+ },
154
+ };
155
+
156
+ // $FlowFixMe
157
+ let toBundle: NamedBundle = {
158
+ filePath:
159
+ '/user/dist/assets/image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
160
+ name: 'image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
161
+ // $FlowFixMe
162
+ target: {
163
+ distDir: '/user/dist/assets',
164
+ publicUrl: 'https://test.com/static',
165
+ },
166
+ };
167
+
168
+ // $FlowFixMe
169
+ let dependency: Dependency = {
170
+ id: '074b36596e3147e900a8ad17ceb5c90b',
171
+ specifier: 'url:./image.jpg?as=webp',
172
+ specifierType: 'esm',
173
+ };
174
+
175
+ let result = getURLReplacement({
176
+ dependency,
177
+ fromBundle,
178
+ toBundle,
179
+ relative: true,
180
+ });
181
+
182
+ assert.equal(
183
+ result.to,
184
+ 'assets/image.HASH_REF_87f9d66c16c2216ccc7e5664cf089305.webp',
185
+ );
186
+ assert.equal(result.from, '074b36596e3147e900a8ad17ceb5c90b');
187
+ });
188
+
189
+ it('should work with bundle names with colons, relative', () => {
190
+ // $FlowFixMe
191
+ let fromBundle: NamedBundle = {
192
+ filePath: '/user/dist/reformat.html',
193
+ name: 'reformat.html',
194
+ // $FlowFixMe
195
+ target: {
196
+ distDir: '/user/dist',
197
+ publicUrl: '/',
198
+ },
199
+ };
200
+
201
+ // $FlowFixMe
202
+ let toBundle: NamedBundle = {
203
+ filePath: '/user/dist/a:b:c.html',
204
+ name: 'a:b:c.html',
205
+ // $FlowFixMe
206
+ target: {
207
+ distDir: '/user/dist',
208
+ publicUrl: '/',
209
+ },
210
+ };
211
+
212
+ // $FlowFixMe
213
+ let dependency: Dependency = {
214
+ id: '074b36596e3147e900a8ad17ceb5c90b',
215
+ specifier: './a:b:c.html',
216
+ specifierType: 'esm',
217
+ };
218
+
219
+ let result = getURLReplacement({
220
+ dependency,
221
+ fromBundle,
222
+ toBundle,
223
+ relative: true,
224
+ });
225
+
226
+ assert.equal(result.to, './a:b:c.html');
227
+ });
228
+
229
+ it('should work with bundle names with colons, absolute', () => {
230
+ // $FlowFixMe
231
+ let fromBundle: NamedBundle = {
232
+ filePath: '/user/dist/reformat.html',
233
+ name: 'reformat.html',
234
+ // $FlowFixMe
235
+ target: {
236
+ distDir: '/user/dist',
237
+ publicUrl: '/',
238
+ },
239
+ };
240
+
241
+ // $FlowFixMe
242
+ let toBundle: NamedBundle = {
243
+ filePath: '/user/dist/a:b:c.html',
244
+ name: 'a:b:c.html',
245
+ // $FlowFixMe
246
+ target: {
247
+ distDir: '/user/dist',
248
+ publicUrl: '/',
249
+ },
250
+ };
251
+
252
+ // $FlowFixMe
253
+ let dependency: Dependency = {
254
+ id: '074b36596e3147e900a8ad17ceb5c90b',
255
+ specifier: './a:b:c.html',
256
+ specifierType: 'esm',
257
+ };
258
+
259
+ let result = getURLReplacement({
260
+ dependency,
261
+ fromBundle,
262
+ toBundle,
263
+ relative: false,
264
+ });
265
+
266
+ assert.equal(result.to, '/a:b:c.html');
267
+ });
268
+ });