vite-plugin-conditional-imports 0.1.2 → 0.1.3
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/dist/index.js +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -271,13 +271,13 @@ function conditionalImports(shouldStrip, options) {
|
|
|
271
271
|
}
|
|
272
272
|
},
|
|
273
273
|
async writeBundle(options2, bundle) {
|
|
274
|
-
if (!pluginRequestedSourcemap || !options2.dir)
|
|
275
|
-
|
|
276
|
-
if (name.endsWith(".map")) {
|
|
277
|
-
await unlink(join2(options2.dir, name)).catch(() => {
|
|
278
|
-
});
|
|
279
|
-
}
|
|
274
|
+
if (!pluginRequestedSourcemap || !options2.dir) {
|
|
275
|
+
return;
|
|
280
276
|
}
|
|
277
|
+
log("Deleting build-only source maps");
|
|
278
|
+
const dir = options2.dir;
|
|
279
|
+
const toDelete = Object.keys(bundle).filter((name) => name.endsWith(".map")).map((name) => join2(dir, name));
|
|
280
|
+
await Promise.all(toDelete.map((path2) => unlink(path2)));
|
|
281
281
|
}
|
|
282
282
|
};
|
|
283
283
|
}
|
package/package.json
CHANGED