mirror of
https://github.com/arc53/DocsGPT
synced 2024-11-17 21:26:26 +00:00
fix: added targets for browser environment
This commit is contained in:
parent
f2c328d212
commit
72a1892058
@ -52,8 +52,8 @@ To link the widget to your api and your documents you can pass parameters to the
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<!-- Include the widget script -->
|
||||
<script src="./node_modules/docsgpt/dist/main.js" type="module"></script>
|
||||
<!-- Include the widget script from dist/modern or dist/legacy -->
|
||||
<script src="./node_modules/docsgpt/dist/modern/main.js" type="module"></script>
|
||||
<script type="module">
|
||||
window.onload = function() {
|
||||
renderDocsGPTWidget('app');
|
||||
@ -63,8 +63,6 @@ To link the widget to your api and your documents you can pass parameters to the
|
||||
</html>
|
||||
```
|
||||
|
||||
##### Serve the HTML using Parcel: `parcel my-widget.html -p 3000`
|
||||
|
||||
To link the widget to your api and your documents you can pass parameters to the **renderDocsGPTWidget('div id', { parameters })**.
|
||||
|
||||
```html
|
||||
@ -78,8 +76,8 @@ To link the widget to your api and your documents you can pass parameters to the
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<!-- Include the widget script -->
|
||||
<script src="./node_modules/docsgpt/dist/main.js" type="module"></script>
|
||||
<!-- Include the widget script from dist/modern or dist/legacy -->
|
||||
<script src="./node_modules/docsgpt/dist/modern/main.js" type="module"></script>
|
||||
<script type="module">
|
||||
window.onload = function() {
|
||||
renderDocsGPTWidget('app', , {
|
||||
|
@ -11,6 +11,18 @@
|
||||
"dist",
|
||||
"package.json"
|
||||
],
|
||||
"targets": {
|
||||
"modern": {
|
||||
"engines": {
|
||||
"browsers": "Chrome 80"
|
||||
}
|
||||
},
|
||||
"legacy": {
|
||||
"engines": {
|
||||
"browsers": "> 0.5%, last 2 versions, not dead"
|
||||
}
|
||||
}
|
||||
},
|
||||
"@parcel/resolver-default": {
|
||||
"packageExports": true
|
||||
},
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { DocsGPTWidget } from './components/DocsGPTWidget';
|
||||
|
||||
const renderWidget = (elementId: string, props = {}) => {
|
||||
|
Loading…
Reference in New Issue
Block a user