Skip to content

Commit d0d5a47

Browse files
shailee-mbrylie
authored andcommitted
[#366] cleaning up dependencies and keep required code. Added docs
1 parent 0a0529b commit d0d5a47

File tree

4 files changed

+241
-68
lines changed

4 files changed

+241
-68
lines changed

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ npm run serve
2828

2929
You should now have the application running and accessible at <http://localhost:8080> (note: will run on a different port if 8080 is occupied, most common alternative port is 8081).
3030

31+
## Building as web component
32+
To build the project as a web component, run the command `npm run build-component`. This will create a file in the `dist` folder named `license-chooser.min.js`. It can be used to load the web-component in any JS project. There is also a sample `demo.html` created.
33+
To be able to use the file it should either be rendered statically from the integrater's web-app or be published on a CDN. Following code can be used to integrate this in other apps:
34+
35+
```
36+
<script src="https://unpkg.com/vue"></script>
37+
<!-- If the licenser-chooser file is hosted on http://127.0.0.1:8081 -->
38+
<script src="http://127.0.0.1:8081/license-chooser.js"></script>
39+
40+
<license-chooser></license-chooser>
41+
```
42+
43+
If the web component is intended to be built without header and footer, run `VUE_APP_CC_OUTPUT=embedded npm run build-component`
44+
3145
## Contributing
3246

3347
For information on contributing, please see [Creative Commons' Contribution Guidelines](https://opensource.creativecommons.org/contributing-code/)
@@ -47,6 +61,8 @@ You can run tests by executing:
4761
```bash
4862
npm run test
4963
```
64+
For running tests on a web-component build, run `npm run test-component`. It starts a server with the `dist/demo.html` on which tests can be run.
65+
5066

5167
## CSS Build
5268

0 commit comments

Comments
 (0)