fragmentor 0.2.0 → 0.2.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.
|
@@ -56,8 +56,9 @@ async function variants(sharp, bytes) {
|
|
|
56
56
|
export async function optimize(files, { parse, read }) {
|
|
57
57
|
const out = { ...files };
|
|
58
58
|
const warnings = [];
|
|
59
|
-
|
|
60
|
-
const
|
|
59
|
+
/* Ignored by bundlers, so an app that bundles fragmentor for the browser doesn't pull in these Node-only packages */
|
|
60
|
+
const esbuild = await import(/* webpackIgnore: true */ /* turbopackIgnore: true */ "esbuild").catch(() => null);
|
|
61
|
+
const sharp = await import(/* webpackIgnore: true */ /* turbopackIgnore: true */ "sharp").then((m) => m.default).catch(() => null);
|
|
61
62
|
if (!esbuild)
|
|
62
63
|
warnings.push("esbuild isn't installed, so CSS and JS aren't minified");
|
|
63
64
|
if (!sharp)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fragmentor",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "The open-source build engine for Fragmentor.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/src/index.d.ts",
|
|
15
|
-
"import": "./dist/src/index.js"
|
|
15
|
+
"import": "./dist/src/index.js",
|
|
16
|
+
"default": "./dist/src/index.js"
|
|
16
17
|
}
|
|
17
18
|
},
|
|
18
19
|
"files": [
|