rollup / rollup

@@ -185,9 +185,11 @@
Loading
185 185
186 186
const getResolveUrl = (path: string, URL = 'URL') => `new ${URL}(${path}).href`;
187 187
188 -
const getRelativeUrlFromDocument = (relativePath: string) =>
188 +
const getRelativeUrlFromDocument = (relativePath: string, umd = false) =>
189 189
	getResolveUrl(
190 -
		`'${relativePath}', document.currentScript && document.currentScript.src || document.baseURI`
190 +
		`'${relativePath}', ${
191 +
			umd ? `typeof document === 'undefined' ? location.href : ` : ''
192 +
		}document.currentScript && document.currentScript.src || document.baseURI`
191 193
	);
192 194
193 195
const getGenericImportMetaMechanism =
@@ -200,8 +202,10 @@
Loading
200 202
			: 'undefined';
201 203
	};
202 204
203 -
const getUrlFromDocument = (chunkId: string) =>
204 -
	`(document.currentScript && document.currentScript.src || new URL('${chunkId}', document.baseURI).href)`;
205 +
const getUrlFromDocument = (chunkId: string, umd = false) =>
206 +
	`${
207 +
		umd ? `typeof document === 'undefined' ? location.href : ` : ''
208 +
	}(document.currentScript && document.currentScript.src || new URL('${chunkId}', document.baseURI).href)`;
205 209
206 210
const relativeUrlMechanisms: Record<InternalModuleFormat, (relativePath: string) => string> = {
207 211
	amd: relativePath => {
@@ -217,10 +221,10 @@
Loading
217 221
	iife: relativePath => getRelativeUrlFromDocument(relativePath),
218 222
	system: relativePath => getResolveUrl(`'${relativePath}', module.meta.url`),
219 223
	umd: relativePath =>
220 -
		`(typeof document === 'undefined' ? ${getResolveUrl(
224 +
		`(typeof document === 'undefined' && typeof location === 'undefined' ? ${getResolveUrl(
221 225
			`'file:' + __dirname + '/${relativePath}'`,
222 226
			`(require('u' + 'rl').URL)`
223 -
		)} : ${getRelativeUrlFromDocument(relativePath)})`
227 +
		)} : ${getRelativeUrlFromDocument(relativePath, true)})`
224 228
};
225 229
226 230
const importMetaMechanisms: Record<string, (prop: string | null, chunkId: string) => string> = {
@@ -236,9 +240,9 @@
Loading
236 240
	system: prop => (prop === null ? `module.meta` : `module.meta.${prop}`),
237 241
	umd: getGenericImportMetaMechanism(
238 242
		chunkId =>
239 -
			`(typeof document === 'undefined' ? ${getResolveUrl(
243 +
			`(typeof document === 'undefined' && typeof location === 'undefined' ? ${getResolveUrl(
240 244
				`'file:' + __filename`,
241 245
				`(require('u' + 'rl').URL)`
242 -
			)} : ${getUrlFromDocument(chunkId)})`
246 +
			)} : ${getUrlFromDocument(chunkId, true)})`
243 247
	)
244 248
};
Files Coverage
cli 94.74%
src 98.64%
browser/path.ts 76.92%
Project Totals (202 files) 98.34%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading