uglify-js-minify-css-allfiles 2.2.1 → 2.2.2

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,7 +5,7 @@ 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
8
+ ## [2.2.2] - 2024-08-22
9
9
 
10
10
  ### Fixed
11
11
 
package/dist/module.js CHANGED
@@ -9,6 +9,17 @@ 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 { createRequire } from 'module';
13
+ import { fileURLToPath, pathToFileURL } from 'url';
14
+
15
+ const require = createRequire(import.meta.url);
16
+ const __filename = fileURLToPath(import.meta.url);
17
+ const __dirname = path.dirname(__filename);
18
+
19
+ function resolveModulePath(moduleName) {
20
+ const modulePath = require.resolve(moduleName, { paths: [__dirname] });
21
+ return pathToFileURL(modulePath).href;
22
+ }
12
23
 
13
24
  /**
14
25
  * Object containing handlers for different file types.
@@ -30,7 +41,8 @@ const FILE_HANDLERS = {
30
41
  try {
31
42
  let transformed = content;
32
43
  if (options.babelOptions) {
33
- const { transformSync } = await import('@babel/core');
44
+ const babelCoreUrl = resolveModulePath('@babel/core');
45
+ const { transformSync } = await import(babelCoreUrl);
34
46
  transformed = transformSync(content, options.babelOptions).code;
35
47
  }
36
48
  const result = minifyJS(transformed, options.jsMinifyOptions);
@@ -2,3 +2,7 @@
2
2
  [08/22/2024, 02:34:34] [INFO] Writing file: C:\Users\PEARL\Desktop\uglify-js-minify-css-allfiles\test\test.css
3
3
  [08/22/2024, 02:34:35] [INFO] Writing file: C:\Users\PEARL\Desktop\uglify-js-minify-css-allfiles\test\test.js
4
4
  [08/22/2024, 02:34:35] [INFO] Processing Summary {"summary":{"totalFilesProcessed":2,"filesWithErrors":0,"errorCount":0,"errorFiles":[]}}
5
+ [08/22/2024, 06:58:25] [INFO] Starting minification process {"contentPath":"./test/","excludeFolder":"lib","useBabel":{"targets":"chrome 40"}}
6
+ [08/22/2024, 06:58:25] [INFO] Writing file: C:\Users\PEARL\Desktop\uglify-js-minify-css-allfiles\test\test.css
7
+ [08/22/2024, 06:58:27] [INFO] Writing file: C:\Users\PEARL\Desktop\uglify-js-minify-css-allfiles\test\test.js
8
+ [08/22/2024, 06:58:27] [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.1",
3
+ "version": "2.2.2",
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",