@zhaoshijun/compress 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/bin/compress.js +4 -1
  2. package/package.json +1 -1
package/bin/compress.js CHANGED
@@ -12,13 +12,16 @@ import { loadConfig } from '../src/config/loader.js';
12
12
  import { compressImage } from '../src/core/compressor.js';
13
13
  import { DEFAULT_EXCLUDES } from '../src/utils/constants.js';
14
14
  import { isSupportedImage as isSupported } from '../src/utils/file-utils.js';
15
+ import { createRequire } from 'module';
16
+ const require = createRequire(import.meta.url);
17
+ const packageJson = require('../package.json');
15
18
 
16
19
  const program = new Command();
17
20
 
18
21
  program
19
22
  .name('compress')
20
23
  .description('Image compression CLI tool')
21
- .version('1.0.0');
24
+ .version(packageJson.version);
22
25
 
23
26
  program
24
27
  .option('-c, --config <path>', '配置文件路径')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhaoshijun/compress",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Image compression CLI and Vite plugin",
5
5
  "type": "module",
6
6
  "bin": {