uglify-js-minify-css-allfiles 2.2.0 → 2.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.2.1] - 2024-08-22
9
+
10
+ ### Fixed
11
+
12
+ - `excludeFolder` option now correctly excludes files in deeply nested directories
13
+ - Resolved `@babel/preset-env` dependency issue by implementing dynamic import for `babel-core`
14
+
8
15
  ## [2.2.0] - 2024-08-21
9
16
 
10
17
  ### Added
@@ -105,12 +112,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
105
112
 
106
113
  - New `exceptFolder` parameter to exclude specific folders from minification
107
114
  - Support for using relative paths
108
-
109
- [2.2.0]: https://github.com/oinochoe/uglify-js-minify-css-allfiles/compare/v2.1.0...v2.2.0
110
- [2.1.0]: https://github.com/oinochoe/uglify-js-minify-css-allfiles/compare/v2.0.0...v2.1.0
111
- [2.0.0]: https://github.com/oinochoe/uglify-js-minify-css-allfiles/compare/v1.3.2...v2.0.0
112
- [1.3.2]: https://github.com/oinochoe/uglify-js-minify-css-allfiles/compare/v1.3.1...v1.3.2
113
- [1.3.1]: https://github.com/oinochoe/uglify-js-minify-css-allfiles/compare/v1.3.0...v1.3.1
114
- [1.3.0]: https://github.com/oinochoe/uglify-js-minify-css-allfiles/compare/v1.2.0...v1.3.0
115
- [1.2.0]: https://github.com/oinochoe/uglify-js-minify-css-allfiles/compare/v1.1.0...v1.2.0
116
- [1.1.0]: https://github.com/oinochoe/uglify-js-minify-css-allfiles/releases/tag/v1.1.0
package/dist/module.js CHANGED
@@ -9,7 +9,6 @@ import path from 'path';
9
9
  import Logger from './modules/logger.js';
10
10
  import { getAllFiles, writeFile } from './modules/fileHandler.js';
11
11
  import { minifyJS, minifyCSS } from './modules/minifier.js';
12
- import babelCore from '@babel/core';
13
12
 
14
13
  /**
15
14
  * Object containing handlers for different file types.
@@ -31,7 +30,8 @@ const FILE_HANDLERS = {
31
30
  try {
32
31
  let transformed = content;
33
32
  if (options.babelOptions) {
34
- transformed = babelCore.transformSync(content, options.babelOptions).code;
33
+ const { transformSync } = await import('@babel/core');
34
+ transformed = transformSync(content, options.babelOptions).code;
35
35
  }
36
36
  const result = minifyJS(transformed, options.jsMinifyOptions);
37
37
  await writeFile(filePath, result, logger);
@@ -177,7 +177,12 @@ export default async function minifyAll(contentPath, options = {}) {
177
177
 
178
178
  try {
179
179
  await getAllFiles(rootDir, async (filePath) => {
180
- if (excludeFolder && path.relative(rootDir, filePath).startsWith(excludeFolder)) {
180
+ const relativePath = path.relative(rootDir, filePath);
181
+ if (
182
+ excludeFolder &&
183
+ (relativePath.startsWith(excludeFolder) ||
184
+ relativePath.includes(path.sep + excludeFolder + path.sep))
185
+ ) {
181
186
  await logger?.debug('Skipping excluded file', { filePath });
182
187
  return;
183
188
  }
@@ -0,0 +1,4 @@
1
+ [08/22/2024, 02:34:34] [INFO] Starting minification process {"contentPath":"./test/","excludeFolder":"lib","useBabel":{"targets":"chrome 40"}}
2
+ [08/22/2024, 02:34:34] [INFO] Writing file: C:\Users\PEARL\Desktop\uglify-js-minify-css-allfiles\test\test.css
3
+ [08/22/2024, 02:34:35] [INFO] Writing file: C:\Users\PEARL\Desktop\uglify-js-minify-css-allfiles\test\test.js
4
+ [08/22/2024, 02:34:35] [INFO] Processing Summary {"summary":{"totalFilesProcessed":2,"filesWithErrors":0,"errorCount":0,"errorFiles":[]}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uglify-js-minify-css-allfiles",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "you will be able to minify all files as same file names which is js or css",
5
5
  "main": "minify.js",
6
6
  "type": "module",