You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-30
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,9 @@ This project was bootstrapped with [Vue CLI](https://cli.vuejs.org/)
22
22
npm install
23
23
```
24
24
25
-
1. Start a local server and run the application. (The running application can be found here: http://localhost:8080)
25
+
1. Start a local server and run the application. (The running application can be found here: http://localhost:5173)
26
26
```sh
27
-
npm run serve
27
+
npm run dev
28
28
```
29
29
30
30
@@ -49,40 +49,29 @@ Then, you can use the custom element in an HTML page:
49
49
50
50
Currently Chrome, Safari, Firefox and Edge (Chromium-based) support Web Components natively.
51
51
52
-
53
52
## Configure Vue to work with Web Components defined outside of it
54
-
To use Web Components in Vue Application a configuration option should be provided in the `main.js` file to tell the Vue about these components. More can be found in the documentation of [Vue.config.ignoredElements](https://vuejs.org/v2/api/#ignoredElements):
55
53
56
-
**main.js**
57
-
```js
58
-
Vue.config.ignoredElements = [/^ui5-/];
59
-
```
54
+
It is recommended to exclude our custom elements from component resolution by specifying `compilerOptions.isCustomElement`in our `vite.config` file.
60
55
56
+
```ts
57
+
// vite.config.js
61
58
62
-
## Configure Vue Build
63
-
When UI5 Web Components are used they include all of their translation files and CLDR data files in the application bundle.
64
-
In order to decrease the bundle size of the application a custom Webpack configuration should be provided.
59
+
import { defineConfig } from 'vite'
60
+
import vue from '@vitejs/plugin-vue'
65
61
66
-
Create `vue.config.js` file:
67
-
68
-
**vue.config.js**
69
-
```js
70
-
module.exports = {
71
-
configureWebpack: {
72
-
module: {
73
-
rules: [
74
-
{
75
-
test: [/cldr\/.*\.json$/, /i18n\/.*\.json$/],
76
-
loader: 'file-loader',
77
-
options: {
78
-
name: 'static/media/[name].[hash:8].[ext]',
79
-
},
80
-
type: 'javascript/auto'
62
+
// https://vitejs.dev/config/
63
+
export default defineConfig({
64
+
plugins: [
65
+
vue({
66
+
template: {
67
+
compilerOptions: {
68
+
// treat all tags with a "ui5-" prefix as custom elements
0 commit comments