@rollup/plugin-esm-shim
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -52,5 +52,21 @@ 'use strict'; | ||
s.appendRight(indexToAppend, ESMShim); | ||
const sourceMap = s.generateMap({ | ||
includeContent: true | ||
}); | ||
let sourcesContent; | ||
if (Array.isArray(sourceMap.sourcesContent)) { | ||
sourcesContent = []; | ||
for (let i = 0; i < sourceMap.sourcesContent.length; i++) { | ||
const content = sourceMap.sourcesContent[i]; | ||
if (typeof content === 'string') { | ||
sourcesContent.push(content); | ||
} | ||
} | ||
} | ||
return { | ||
code: s.toString(), | ||
map: s.generateMap() | ||
map: { | ||
...sourceMap, | ||
sourcesContent | ||
} | ||
}; | ||
@@ -57,0 +73,0 @@ } |
@@ -48,5 +48,21 @@ import MagicString from 'magic-string'; | ||
s.appendRight(indexToAppend, ESMShim); | ||
const sourceMap = s.generateMap({ | ||
includeContent: true | ||
}); | ||
let sourcesContent; | ||
if (Array.isArray(sourceMap.sourcesContent)) { | ||
sourcesContent = []; | ||
for (let i = 0; i < sourceMap.sourcesContent.length; i++) { | ||
const content = sourceMap.sourcesContent[i]; | ||
if (typeof content === 'string') { | ||
sourcesContent.push(content); | ||
} | ||
} | ||
} | ||
return { | ||
code: s.toString(), | ||
map: s.generateMap() | ||
map: { | ||
...sourceMap, | ||
sourcesContent | ||
} | ||
}; | ||
@@ -53,0 +69,0 @@ } |
{ | ||
"name": "@rollup/plugin-esm-shim", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"publishConfig": { | ||
@@ -63,3 +63,3 @@ "access": "public" | ||
"dependencies": { | ||
"magic-string": "^0.27.0" | ||
"magic-string": "^0.30.0" | ||
}, | ||
@@ -66,0 +66,0 @@ "devDependencies": { |
@@ -46,6 +46,23 @@ import MagicString from 'magic-string'; | ||
const sourceMap = s.generateMap({ | ||
includeContent: true | ||
}); | ||
let sourcesContent: string[] | undefined; | ||
if (Array.isArray(sourceMap.sourcesContent)) { | ||
sourcesContent = []; | ||
for (let i = 0; i < sourceMap.sourcesContent.length; i++) { | ||
const content = sourceMap.sourcesContent[i]; | ||
if (typeof content === 'string') { | ||
sourcesContent.push(content); | ||
} | ||
} | ||
} | ||
return { | ||
code: s.toString(), | ||
map: s.generateMap() | ||
map: { | ||
...sourceMap, | ||
sourcesContent | ||
} | ||
}; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12543
277
+ Addedmagic-string@0.30.13(transitive)
- Removedmagic-string@0.27.0(transitive)
Updatedmagic-string@^0.30.0