@pz4l/tinyimg-unplugin 0.1.1-beta.2 → 0.3.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.
Files changed (2) hide show
  1. package/README.md +6 -66
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -16,24 +16,6 @@
16
16
  npm install @pz4l/tinyimg-unplugin -D
17
17
  ```
18
18
 
19
- ### Testing Installation
20
-
21
- To verify the package installs correctly without workspace dependency errors:
22
-
23
- ```bash
24
- # Test in a clean directory outside the monorepo
25
- cd /tmp
26
- mkdir test-tinyimg && cd test-tinyimg
27
- pnpm init
28
- pnpm add @pz4l/tinyimg-unplugin@latest
29
-
30
- # Verify installation
31
- pnpm list @pz4l/tinyimg-unplugin @pz4l/tinyimg-core
32
-
33
- # Check that dependencies are resolved (no workspace:* protocol)
34
- cat node_modules/@pz4l/tinyimg-unplugin/package.json | grep dependencies
35
- ```
36
-
37
19
  ## Environment Setup
38
20
 
39
21
  ### TINYPNG_KEYS 环境变量
@@ -55,64 +37,22 @@ export TINYPNG_KEYS=key1,key2,key3
55
37
 
56
38
  ### 在项目中配置环境变量
57
39
 
58
- #### Vite 项目
59
-
60
- 创建 `.env` 文件:
61
-
62
- ```bash
63
- TINYPNG_KEYS=your_api_key_here
64
- ```
65
-
66
- Vite 会自动加载 `.env` 文件,无需额外配置。
67
-
68
- #### Webpack 项目
69
-
70
- 创建 `.env` 文件:
40
+ **Vite 项目**(`.env` 文件):
71
41
 
72
42
  ```bash
73
43
  TINYPNG_KEYS=your_api_key_here
74
44
  ```
75
45
 
76
- 安装 dotenv-webpack 插件:
77
-
78
- ```bash
79
- npm install dotenv-webpack -D
80
- ```
81
-
82
- 在 `webpack.config.js` 中配置:
46
+ **Webpack 项目**(`webpack.config.js`):
83
47
 
84
48
  ```javascript
85
- const Dotenv = require('dotenv-webpack')
49
+ const webpack = require('webpack')
86
50
 
87
51
  module.exports = {
88
52
  plugins: [
89
- new Dotenv()
90
- ]
91
- }
92
- ```
93
-
94
- #### Rolldown 项目
95
-
96
- 创建 `.env` 文件:
97
-
98
- ```bash
99
- TINYPNG_KEYS=your_api_key_here
100
- ```
101
-
102
- 安装 @rollup/plugin-dotsenv 插件:
103
-
104
- ```bash
105
- npm install @rollup/plugin-dotsenv -D
106
- ```
107
-
108
- 在 `rolldown.config.js` 中配置:
109
-
110
- ```javascript
111
- import dotsenv from '@rollup/plugin-dotsenv'
112
-
113
- export default {
114
- plugins: [
115
- dotsenv()
53
+ new webpack.DefinePlugin({
54
+ 'process.env.TINYPNG_KEYS': JSON.stringify('your_api_key_here')
55
+ })
116
56
  ]
117
57
  }
118
58
  ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pz4l/tinyimg-unplugin",
3
3
  "type": "module",
4
- "version": "0.1.1-beta.2",
4
+ "version": "0.3.1",
5
5
  "description": "unplugin for automatic image compression during build (Vite, Webpack, Rolldown)",
6
6
  "author": "pzehrel",
7
7
  "license": "MIT",
@@ -62,7 +62,7 @@
62
62
  "dependencies": {
63
63
  "micromatch": "^4.0.8",
64
64
  "unplugin": "^1.0.0",
65
- "@pz4l/tinyimg-core": "0.1.1-beta.2"
65
+ "@pz4l/tinyimg-core": "0.3.1"
66
66
  },
67
67
  "devDependencies": {
68
68
  "fast-glob": "^3.3.3",