From 03d641a0d7f996de44ec898ad739bc4050514ba1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Dec 2019 16:17:22 +0100 Subject: Add embed api build --- client/src/standalone/player/.npmignore | 3 +++ client/src/standalone/player/package.json | 11 ++++++++--- client/src/standalone/player/player.ts | 2 +- client/src/standalone/player/tsconfig.json | 19 +++++++++++++++++++ client/src/standalone/player/webpack.config.js | 12 ++++++++++++ 5 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 client/src/standalone/player/.npmignore create mode 100644 client/src/standalone/player/tsconfig.json create mode 100644 client/src/standalone/player/webpack.config.js (limited to 'client/src/standalone') 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 @@ +tsconfig.json +*.ts +webpack.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 @@ { "name": "@peertube/embed-api", - "version": "1.0.0", + "private": false, + "version": "0.0.1", "description": "API to communicate with the PeerTube player embed", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" @@ -13,11 +14,15 @@ "peertube", "embed" ], - "main": "./player.ts", + "main": "./dist/player.js", + "types": "./dist/player.d.ts", "author": "Chocobozzz", "license": "AGPL-3.0", "bugs": { "url": "https://github.com/Chocobozzz/PeerTube/issues" }, - "homepage": "https://github.com/Chocobozzz/PeerTube#readme" + "homepage": "https://github.com/Chocobozzz/PeerTube#readme", + "dependencies": { + "jschannel": "^1.0.2" + } } 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 { } // put it on the window as well as the export -window[ 'PeerTubePlayer' ] = PeerTubePlayer +(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 @@ +{ + "compilerOptions": { + "module": "commonjs", + "removeComments": true, + "sourceMap": false, + "typeRoots": [ + "../../../node_modules/@types" + ], + "outDir": "./dist", + "declaration": true, + "target": "es5", + "types": [], + "lib": [ + "es2018", + "dom" + ] + }, + "files": [ "./player.ts" ] +} 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 @@ +const path = require('path') + +module.exports = [ + { + mode: 'production', + entry: './dist/player.js', + output: { + filename: 'player.min.js', + path: path.resolve(__dirname, 'build') + } + } +] -- cgit v1.2.3