@tamagui/build 1.92.0 → 1.92.1
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.
- package/package.json +1 -1
- package/tamagui-build.js +16 -1
package/package.json
CHANGED
package/tamagui-build.js
CHANGED
|
@@ -562,8 +562,23 @@ async function esbuildWriteIfChanged(
|
|
|
562
562
|
}
|
|
563
563
|
|
|
564
564
|
if (pkgRemoveSideEffects && isESM) {
|
|
565
|
+
const allowedSideEffects = pkg.sideEffects || []
|
|
566
|
+
|
|
567
|
+
const result = []
|
|
568
|
+
const lines = outString.split('\n')
|
|
569
|
+
for (const line of lines) {
|
|
570
|
+
if (
|
|
571
|
+
!line.startsWith('import ') ||
|
|
572
|
+
allowedSideEffects.some((allowed) => line.includes(allowed))
|
|
573
|
+
) {
|
|
574
|
+
result.push(line)
|
|
575
|
+
continue
|
|
576
|
+
}
|
|
577
|
+
result.push(line.replace(/import "[^"]+";/g, ''))
|
|
578
|
+
}
|
|
579
|
+
|
|
565
580
|
// match whitespace to preserve sourcemaps
|
|
566
|
-
outString =
|
|
581
|
+
outString = result.join('\n')
|
|
567
582
|
}
|
|
568
583
|
|
|
569
584
|
async function flush(contents, path) {
|