lime-elements-vue 1.0.8 → 1.0.10
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/README.md +46 -19
- package/dist/index.cjs.js +22 -20
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -29,12 +29,12 @@ export default defineConfig({
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}),
|
|
32
|
-
// Copy lime-elements
|
|
32
|
+
// Copy lime-elements ESM files to assets folder
|
|
33
33
|
viteStaticCopy({
|
|
34
34
|
targets: [
|
|
35
35
|
{
|
|
36
|
-
src: 'node_modules/@limetech/lime-elements/dist',
|
|
37
|
-
dest: '
|
|
36
|
+
src: 'node_modules/@limetech/lime-elements/dist/esm/*',
|
|
37
|
+
dest: 'assets/'
|
|
38
38
|
}
|
|
39
39
|
]
|
|
40
40
|
})
|
|
@@ -54,16 +54,20 @@ npm install -D vite-plugin-static-copy
|
|
|
54
54
|
|
|
55
55
|
### 2. Register the plugin globally
|
|
56
56
|
|
|
57
|
+
**Important:** Set `resourcesUrl` to match where you copied the files in your Vite config.
|
|
58
|
+
|
|
57
59
|
```typescript
|
|
58
60
|
import { createApp } from 'vue'
|
|
59
61
|
import { LimeElementsVue } from 'lime-elements-vue'
|
|
60
62
|
import App from './App.vue'
|
|
61
63
|
|
|
62
64
|
const app = createApp(App)
|
|
63
|
-
|
|
65
|
+
|
|
66
|
+
// Match this to your viteStaticCopy dest path
|
|
64
67
|
app.use(LimeElementsVue, {
|
|
65
|
-
resourcesUrl: '/
|
|
68
|
+
resourcesUrl: '/assets/' // Must match the 'dest' in viteStaticCopy config
|
|
66
69
|
})
|
|
70
|
+
|
|
67
71
|
app.mount('#app')
|
|
68
72
|
```
|
|
69
73
|
|
|
@@ -88,21 +92,39 @@ const handleClick = () => {
|
|
|
88
92
|
</script>
|
|
89
93
|
```
|
|
90
94
|
|
|
91
|
-
##
|
|
95
|
+
## Configuration Options
|
|
96
|
+
|
|
97
|
+
### Development vs Production
|
|
98
|
+
|
|
99
|
+
- **Development**: The default `resourcesUrl` points to `/node_modules/@limetech/lime-elements/dist/` which works with Vite's dev server
|
|
100
|
+
- **Production**: You **must** configure `resourcesUrl` to match where you copy the assets using `vite-plugin-static-copy`
|
|
92
101
|
|
|
93
|
-
|
|
102
|
+
### Alternative: Copy to different location
|
|
94
103
|
|
|
95
|
-
|
|
104
|
+
If you prefer a different location:
|
|
96
105
|
|
|
97
|
-
|
|
106
|
+
```typescript
|
|
107
|
+
// In vite.config.ts
|
|
108
|
+
viteStaticCopy({
|
|
109
|
+
targets: [
|
|
110
|
+
{
|
|
111
|
+
src: 'node_modules/@limetech/lime-elements/dist/esm/*',
|
|
112
|
+
dest: 'lime-elements/' // Custom destination
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
})
|
|
98
116
|
|
|
99
|
-
|
|
117
|
+
// In your app
|
|
118
|
+
app.use(LimeElementsVue, {
|
|
119
|
+
resourcesUrl: '/lime-elements/' // Must match!
|
|
120
|
+
})
|
|
121
|
+
```
|
|
100
122
|
|
|
101
|
-
|
|
123
|
+
### Using a CDN
|
|
102
124
|
|
|
103
125
|
```typescript
|
|
104
126
|
app.use(LimeElementsVue, {
|
|
105
|
-
resourcesUrl: 'https://your-cdn.com/lime-elements/
|
|
127
|
+
resourcesUrl: 'https://your-cdn.com/lime-elements/'
|
|
106
128
|
})
|
|
107
129
|
```
|
|
108
130
|
|
|
@@ -112,17 +134,22 @@ This package provides Vue 3 wrappers for all lime-elements components. For detai
|
|
|
112
134
|
|
|
113
135
|
## Troubleshooting
|
|
114
136
|
|
|
115
|
-
### 404 errors for component files
|
|
137
|
+
### 404 errors for component files
|
|
116
138
|
|
|
117
|
-
If you see 404 errors like `GET http://localhost:xxxx/limel-checkbox.entry.js 404 (Not Found)
|
|
139
|
+
If you see 404 errors like `GET http://localhost:xxxx/limel-checkbox.entry.js 404 (Not Found)`:
|
|
118
140
|
|
|
119
|
-
1.
|
|
120
|
-
2. Ensure
|
|
121
|
-
3.
|
|
141
|
+
1. **Check your `resourcesUrl`** - It must match the `dest` path in `viteStaticCopy` config
|
|
142
|
+
2. **Ensure you're copying the right files** - Use `dist/esm/*` not just `dist`
|
|
143
|
+
3. **Include trailing slash** - `resourcesUrl: '/assets/'` not `/assets`
|
|
144
|
+
4. **Configure Vite properly**:
|
|
145
|
+
- `optimizeDeps.exclude: ['@limetech/lime-elements']`
|
|
146
|
+
- `isCustomElement: (tag) => tag.includes('-')`
|
|
122
147
|
|
|
123
|
-
### 404 errors
|
|
148
|
+
### Development mode 404 errors
|
|
124
149
|
|
|
125
|
-
|
|
150
|
+
For development, either:
|
|
151
|
+
- Use the default (no resourcesUrl option) which points to `/node_modules/@limetech/lime-elements/dist/`
|
|
152
|
+
- Or configure Vite's server to serve node_modules
|
|
126
153
|
|
|
127
154
|
## License
|
|
128
155
|
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
get: function () { return components_1[key]; }
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const loader_1 = require("@limetech/lime-elements/loader");
|
|
16
|
-
|
|
17
|
-
exports.LimeElementsVue = {
|
|
18
|
-
async install() {
|
|
19
|
-
loader_1.applyPolyfills().then(() => {
|
|
20
|
-
loader_1.defineCustomElements();
|
|
21
|
-
});
|
|
22
|
-
}
|
|
17
|
+
__exportStar(require("./components"), exports);
|
|
18
|
+
const loader_1 = require("@limetech/lime-elements/dist/loader");
|
|
19
|
+
exports.default = {
|
|
20
|
+
install(app) {
|
|
21
|
+
(0, loader_1.applyPolyfills)().then(() => {
|
|
22
|
+
(0, loader_1.defineCustomElements)(window);
|
|
23
|
+
});
|
|
24
|
+
},
|
|
23
25
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ import type { Plugin } from 'vue';
|
|
|
3
3
|
export interface LimeElementsVueOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Custom URL for lime-elements resources.
|
|
6
|
-
*
|
|
6
|
+
* Default: '/node_modules/@limetech/lime-elements/dist/' (works in dev mode)
|
|
7
|
+
* For production, set this to match where you copy the assets
|
|
8
|
+
* Example: '/assets/' if you copy dist/esm/* to assets/
|
|
7
9
|
*/
|
|
8
10
|
resourcesUrl?: string;
|
|
9
11
|
}
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,9 @@ import { applyPolyfills, defineCustomElements } from '@limetech/lime-elements/di
|
|
|
3
3
|
export const LimeElementsVue = {
|
|
4
4
|
async install(_app, options) {
|
|
5
5
|
applyPolyfills().then(() => {
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
const resourcesUrl = options?.resourcesUrl
|
|
6
|
+
// Default works for dev mode with Vite
|
|
7
|
+
// For production, users should set resourcesUrl to match their build config
|
|
8
|
+
const resourcesUrl = options?.resourcesUrl ?? '/node_modules/@limetech/lime-elements/dist/';
|
|
9
9
|
defineCustomElements(window, {
|
|
10
10
|
resourcesUrl
|
|
11
11
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lime-elements-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Vue 3 wrapper for @limetech/lime-elements web components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"lime-elements",
|
|
24
24
|
"stencil"
|
|
25
25
|
],
|
|
26
|
-
"author": "
|
|
26
|
+
"author": "Piotr Adamczyk <piotr.adamczyk@lundalogik.com>",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@limetech/lime-elements": "^38.28.0",
|