@pipelab/plugin-minify 1.0.0-beta.27 → 1.0.0-beta.31
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.cjs +14 -3
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -147167,16 +147167,27 @@ const minifyCode = createAction({
|
|
|
147167
147167
|
outputs: {}
|
|
147168
147168
|
});
|
|
147169
147169
|
const getAllJsFiles = async (dir) => {
|
|
147170
|
-
|
|
147170
|
+
const files = await (0, node_fs_promises.readdir)(dir, { withFileTypes: true });
|
|
147171
|
+
return (await Promise.all(files.map(async (file) => {
|
|
147171
147172
|
const fullPath = (0, node_path.join)(dir, file.name);
|
|
147172
147173
|
if (file.isDirectory()) return getAllJsFiles(fullPath);
|
|
147173
|
-
else if (file.isFile() && fullPath.endsWith(".js")) return fullPath;
|
|
147174
|
+
else if (file.isFile() && fullPath.endsWith(".js")) return [fullPath];
|
|
147174
147175
|
return [];
|
|
147175
|
-
});
|
|
147176
|
+
}))).flat();
|
|
147176
147177
|
};
|
|
147177
147178
|
const minifyCodeRunner = createActionRunner(async ({ log, inputs, cwd, abortSignal }) => {
|
|
147179
|
+
if (abortSignal.aborted) {
|
|
147180
|
+
const abortError = /* @__PURE__ */ new Error("Aborted");
|
|
147181
|
+
abortError.name = "AbortError";
|
|
147182
|
+
throw abortError;
|
|
147183
|
+
}
|
|
147178
147184
|
const jsFiles = await getAllJsFiles(inputs["input-folder"]);
|
|
147179
147185
|
for (const file of jsFiles) {
|
|
147186
|
+
if (abortSignal.aborted) {
|
|
147187
|
+
const abortError = /* @__PURE__ */ new Error("Aborted");
|
|
147188
|
+
abortError.name = "AbortError";
|
|
147189
|
+
throw abortError;
|
|
147190
|
+
}
|
|
147180
147191
|
await import_main.default.build({
|
|
147181
147192
|
entryPoints: [file],
|
|
147182
147193
|
outfile: file,
|
package/dist/index.mjs
CHANGED
|
@@ -147166,16 +147166,27 @@ const minifyCode = createAction({
|
|
|
147166
147166
|
outputs: {}
|
|
147167
147167
|
});
|
|
147168
147168
|
const getAllJsFiles = async (dir) => {
|
|
147169
|
-
|
|
147169
|
+
const files = await readdir(dir, { withFileTypes: true });
|
|
147170
|
+
return (await Promise.all(files.map(async (file) => {
|
|
147170
147171
|
const fullPath = join(dir, file.name);
|
|
147171
147172
|
if (file.isDirectory()) return getAllJsFiles(fullPath);
|
|
147172
|
-
else if (file.isFile() && fullPath.endsWith(".js")) return fullPath;
|
|
147173
|
+
else if (file.isFile() && fullPath.endsWith(".js")) return [fullPath];
|
|
147173
147174
|
return [];
|
|
147174
|
-
});
|
|
147175
|
+
}))).flat();
|
|
147175
147176
|
};
|
|
147176
147177
|
const minifyCodeRunner = createActionRunner(async ({ log, inputs, cwd, abortSignal }) => {
|
|
147178
|
+
if (abortSignal.aborted) {
|
|
147179
|
+
const abortError = /* @__PURE__ */ new Error("Aborted");
|
|
147180
|
+
abortError.name = "AbortError";
|
|
147181
|
+
throw abortError;
|
|
147182
|
+
}
|
|
147177
147183
|
const jsFiles = await getAllJsFiles(inputs["input-folder"]);
|
|
147178
147184
|
for (const file of jsFiles) {
|
|
147185
|
+
if (abortSignal.aborted) {
|
|
147186
|
+
const abortError = /* @__PURE__ */ new Error("Aborted");
|
|
147187
|
+
abortError.name = "AbortError";
|
|
147188
|
+
throw abortError;
|
|
147189
|
+
}
|
|
147179
147190
|
await import_main.default.build({
|
|
147180
147191
|
entryPoints: [file],
|
|
147181
147192
|
outfile: file,
|