Skip to content

Commit

Permalink
release(esbuild): 🔖 Release esbuild-plugin-compress@0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
linbudu599 committed Aug 14, 2022
1 parent ed96595 commit 5d25a61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/esbuild-plugin-compress/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esbuild-plugin-compress",
"version": "0.3.0",
"version": "0.4.0",
"description": "ESBuild plugin for output compression",
"keywords": [
"esbuild",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const compress = (options: CompressOptions = {}): Plugin => {
if (write) {
console.log(
chalk.yellow('WARN'),
' Set write option as true to use compress plugin.'
' Set write option as false to use compress plugin.'
);
return;
}
Expand All @@ -74,7 +74,7 @@ export const compress = (options: CompressOptions = {}): Plugin => {

onEnd(async ({ outputFiles }) => {
for (const { path: originOutputPath, contents } of outputFiles) {
const writrPath = outputDir
const writePath = outputDir
? path.resolve(outputDir, path.basename(originOutputPath))
: originOutputPath;

Expand All @@ -88,12 +88,12 @@ export const compress = (options: CompressOptions = {}): Plugin => {
' Set at least one compression as true to use compress plugin.'
);
} else {
fs.ensureDirSync(path.dirname(writrPath));
fs.ensureDirSync(path.dirname(writePath));
}

gzip ? writeGzipCompress(writrPath, contents, gzipOpts) : void 0;
gzip ? writeGzipCompress(writePath, contents, gzipOpts) : void 0;
brotli
? writeBrotliCompress(writrPath, contents, brotliOpts)
? writeBrotliCompress(writePath, contents, brotliOpts)
: void 0;

if (!removeOrigin || noCompressSpecified) {
Expand Down

0 comments on commit 5d25a61

Please sign in to comment.