@nonfx/vue-flagpack 2.0.0 → 2.0.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 +20 -1
  2. package/package.json +3 -5
package/README.md CHANGED
@@ -30,7 +30,21 @@ Starting from flagpack-core v2.0.0, vue-flagpack supports **tree-shaking**! This
30
30
  ## Installation
31
31
 
32
32
  ```bash
33
- npm install vue-flagpack
33
+ npm install vue-flagpack flagpack-core
34
+ ```
35
+
36
+ **Important:** This package requires a bundler (Vite, Webpack, Rollup, etc.) to work correctly. The dynamic imports used for tree-shaking are processed at build time by your bundler.
37
+
38
+ ### Vite Configuration
39
+
40
+ If you're using Vite, you may need to add the following to your `vite.config.js` to ensure proper handling of the SVG imports:
41
+
42
+ ```js
43
+ export default {
44
+ optimizeDeps: {
45
+ include: ['flagpack-core']
46
+ }
47
+ }
34
48
  ```
35
49
 
36
50
  ## Usage
@@ -140,6 +154,11 @@ Vue-flagpack leverages **dynamic imports** to ensure only the flag SVGs you use
140
154
  - **Optimized Bundles**: Modern bundlers (Vite, Webpack 5, Rollup) will code-split flag SVGs into separate chunks
141
155
  - **On-Demand**: Flags are loaded when the component renders, keeping initial bundle size minimal
142
156
 
157
+ **Requirements:**
158
+ - A bundler is **required** (Vite, Webpack, Rollup, Nuxt, etc.)
159
+ - Both `vue-flagpack` and `flagpack-core` must be installed
160
+ - Direct browser usage via CDN with tree-shaking is not supported
161
+
143
162
  ### Bundle Size Comparison
144
163
 
145
164
  - **Without tree-shaking (v1.x)**: ~16MB (all flags bundled)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nonfx/vue-flagpack",
3
3
  "description": "Gorgeous flag components for your Vue 3 and Nuxt 3 project with tree-shaking support.",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "type": "module",
6
6
  "author": "Yummygum <info@yummygum.com> (https://yummygum.com)",
7
7
  "repository": {
@@ -84,10 +84,8 @@
84
84
  "url": "https://yummygum.com"
85
85
  }
86
86
  ],
87
- "dependencies": {
88
- "flagpack-core": "^2.1.0"
89
- },
90
87
  "peerDependencies": {
91
- "vue": "^3.0.0"
88
+ "vue": "^3.0.0",
89
+ "flagpack-core": "^2.1.0"
92
90
  }
93
91
  }