aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-17 16:17:22 +0100
committerChocobozzz <me@florianbigard.com>2019-12-18 10:14:25 +0100
commit03d641a0d7f996de44ec898ad739bc4050514ba1 (patch)
treedc8d36a945133fdc91fa279b9c97a22f1ec11465 /client
parentc026a2e67357bd4bd4fcc4c10f8c5cd4749435c9 (diff)
downloadPeerTube-03d641a0d7f996de44ec898ad739bc4050514ba1.tar.gz
PeerTube-03d641a0d7f996de44ec898ad739bc4050514ba1.tar.zst
PeerTube-03d641a0d7f996de44ec898ad739bc4050514ba1.zip
Add embed api build
Diffstat (limited to 'client')
-rw-r--r--client/src/standalone/player/.npmignore3
-rw-r--r--client/src/standalone/player/package.json11
-rw-r--r--client/src/standalone/player/player.ts2
-rw-r--r--client/src/standalone/player/tsconfig.json19
-rw-r--r--client/src/standalone/player/webpack.config.js12
5 files changed, 43 insertions, 4 deletions
diff --git a/client/src/standalone/player/.npmignore b/client/src/standalone/player/.npmignore
new file mode 100644
index 000000000..870b6315b
--- /dev/null
+++ b/client/src/standalone/player/.npmignore
@@ -0,0 +1,3 @@
1tsconfig.json
2*.ts
3webpack.config.ts
diff --git a/client/src/standalone/player/package.json b/client/src/standalone/player/package.json
index b056de718..591c3ee3d 100644
--- a/client/src/standalone/player/package.json
+++ b/client/src/standalone/player/package.json
@@ -1,6 +1,7 @@
1{ 1{
2 "name": "@peertube/embed-api", 2 "name": "@peertube/embed-api",
3 "version": "1.0.0", 3 "private": false,
4 "version": "0.0.1",
4 "description": "API to communicate with the PeerTube player embed", 5 "description": "API to communicate with the PeerTube player embed",
5 "scripts": { 6 "scripts": {
6 "test": "echo \"Error: no test specified\" && exit 1" 7 "test": "echo \"Error: no test specified\" && exit 1"
@@ -13,11 +14,15 @@
13 "peertube", 14 "peertube",
14 "embed" 15 "embed"
15 ], 16 ],
16 "main": "./player.ts", 17 "main": "./dist/player.js",
18 "types": "./dist/player.d.ts",
17 "author": "Chocobozzz", 19 "author": "Chocobozzz",
18 "license": "AGPL-3.0", 20 "license": "AGPL-3.0",
19 "bugs": { 21 "bugs": {
20 "url": "https://github.com/Chocobozzz/PeerTube/issues" 22 "url": "https://github.com/Chocobozzz/PeerTube/issues"
21 }, 23 },
22 "homepage": "https://github.com/Chocobozzz/PeerTube#readme" 24 "homepage": "https://github.com/Chocobozzz/PeerTube#readme",
25 "dependencies": {
26 "jschannel": "^1.0.2"
27 }
23} 28}
diff --git a/client/src/standalone/player/player.ts b/client/src/standalone/player/player.ts
index f33539134..71c412950 100644
--- a/client/src/standalone/player/player.ts
+++ b/client/src/standalone/player/player.ts
@@ -192,4 +192,4 @@ export class PeerTubePlayer {
192} 192}
193 193
194// put it on the window as well as the export 194// put it on the window as well as the export
195window[ 'PeerTubePlayer' ] = PeerTubePlayer 195(window[ 'PeerTubePlayer' ] as any) = PeerTubePlayer
diff --git a/client/src/standalone/player/tsconfig.json b/client/src/standalone/player/tsconfig.json
new file mode 100644
index 000000000..eecc63dfb
--- /dev/null
+++ b/client/src/standalone/player/tsconfig.json
@@ -0,0 +1,19 @@
1{
2 "compilerOptions": {
3 "module": "commonjs",
4 "removeComments": true,
5 "sourceMap": false,
6 "typeRoots": [
7 "../../../node_modules/@types"
8 ],
9 "outDir": "./dist",
10 "declaration": true,
11 "target": "es5",
12 "types": [],
13 "lib": [
14 "es2018",
15 "dom"
16 ]
17 },
18 "files": [ "./player.ts" ]
19}
diff --git a/client/src/standalone/player/webpack.config.js b/client/src/standalone/player/webpack.config.js
new file mode 100644
index 000000000..48d350edf
--- /dev/null
+++ b/client/src/standalone/player/webpack.config.js
@@ -0,0 +1,12 @@
1const path = require('path')
2
3module.exports = [
4 {
5 mode: 'production',
6 entry: './dist/player.js',
7 output: {
8 filename: 'player.min.js',
9 path: path.resolve(__dirname, 'build')
10 }
11 }
12]