Skip to content

Commit 5a254c5

Browse files
committed
(docs) add web component build steps
1 parent 54678e1 commit 5a254c5

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Enjoy :smile:
3737
- [Props data structure](#props-data-structure)
3838
- [Events API](#events-api)
3939
- [Using with Firestore](#using-with-firestore)
40+
- [Use as a Web Component](#use-as-a-web-component)
4041

4142
## Installation
4243

@@ -462,6 +463,41 @@ messages: {
462463
}
463464
```
464465

466+
## Use as a Web Component
467+
468+
### Clone vue-advance-chat project
469+
470+
```bash
471+
git clone https://github.com/antoine92190/vue-advanced-chat.git
472+
```
473+
474+
### Build it as a Web Component
475+
476+
```bash
477+
npm i && npm run build:wc
478+
```
479+
480+
### Add Vue.js to your application
481+
482+
```html
483+
<!-- index.html -->
484+
<script src="https://unpkg.com/vue"></script>
485+
```
486+
487+
### Import the built minified component in your application
488+
489+
#### Add vue-advanced-chat.min.js in your application files
490+
491+
```
492+
vue-advance-chat/dist/vue-advanced-chat.min.js
493+
```
494+
495+
#### Import the vue-advanced-chat.min.js file you just added
496+
497+
```javascript
498+
import './vue-advanced-chat.min.js'
499+
```
500+
465501
## License
466502

467503
This project is licensed under [MIT License](http://en.wikipedia.org/wiki/MIT_License)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"serve": "vue-cli-service serve",
2727
"build": "vue-cli-service build",
2828
"build:lib": "vue-cli-service build --target lib --name vue-advanced-chat ./src/ChatWindow/index.js",
29-
"build:wc": "vue-cli-service build --target wc --name vue-advanced-chat ./src/ChatWindow/index.js",
29+
"build:wc": "vue-cli-service build --target wc --name vue-advanced-chat ./src/ChatWindow/ChatWindow.vue",
3030
"prepublish": "npm run build:lib",
3131
"publish-beta": "npm publish --tag beta",
3232
"lint": "vue-cli-service lint"
@@ -48,7 +48,7 @@
4848
"node-sass": "^4.13.0",
4949
"sass": "^1.19.0",
5050
"sass-loader": "^8.0.0",
51-
"vue-template-compiler": "^2.6.10",
51+
"vue-template-compiler": "^2.6.11",
5252
"vue": "^2.6.10"
5353
},
5454
"dependencies": {

0 commit comments

Comments
 (0)