Bundle webtorrent with webpack. Closes https://github.com/Chocobozzz/PeerTube/issues/50
This commit is contained in:
parent
1840c2f7c9
commit
294f80f21e
|
@ -260,10 +260,6 @@ module.exports = function (options) {
|
|||
from: 'src/assets',
|
||||
to: 'assets'
|
||||
},
|
||||
{
|
||||
from: 'node_modules/webtorrent/webtorrent.min.js',
|
||||
to: 'assets/webtorrent'
|
||||
},
|
||||
{
|
||||
from: 'src/standalone',
|
||||
to: 'standalone'
|
||||
|
|
|
@ -83,10 +83,6 @@ module.exports = function (env) {
|
|||
libraryTarget: 'var'
|
||||
},
|
||||
|
||||
externals: {
|
||||
webtorrent: 'WebTorrent'
|
||||
},
|
||||
|
||||
module: {
|
||||
|
||||
// Too slow, life is short
|
||||
|
@ -246,6 +242,7 @@ module.exports = function (env) {
|
|||
node: {
|
||||
global: true,
|
||||
crypto: 'empty',
|
||||
fs: 'empty',
|
||||
process: true,
|
||||
module: false,
|
||||
clearImmediate: false,
|
||||
|
|
|
@ -81,10 +81,6 @@ module.exports = function (env) {
|
|||
publicPath: '/client/'
|
||||
},
|
||||
|
||||
externals: {
|
||||
webtorrent: 'WebTorrent'
|
||||
},
|
||||
|
||||
/**
|
||||
* Add additional plugins to the compiler.
|
||||
*
|
||||
|
@ -272,6 +268,7 @@ module.exports = function (env) {
|
|||
node: {
|
||||
global: true,
|
||||
crypto: 'empty',
|
||||
fs: 'empty',
|
||||
process: false,
|
||||
module: false,
|
||||
clearImmediate: false,
|
||||
|
|
|
@ -21,15 +21,15 @@ import { WebTorrentService } from './webtorrent.service';
|
|||
})
|
||||
|
||||
export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||
private static LOADTIME_TOO_LONG: number = 20000;
|
||||
private static LOADTIME_TOO_LONG = 20000;
|
||||
|
||||
@ViewChild('videoMagnetModal') videoMagnetModal: VideoMagnetComponent;
|
||||
@ViewChild('videoShareModal') videoShareModal: VideoShareComponent;
|
||||
@ViewChild('videoReportModal') videoReportModal: VideoReportComponent;
|
||||
|
||||
downloadSpeed: number;
|
||||
error: boolean = false;
|
||||
loading: boolean = false;
|
||||
error = false;
|
||||
loading = false;
|
||||
numPeers: number;
|
||||
player: videojs.Player;
|
||||
playerElement: Element;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
|
||||
declare const WebTorrent;
|
||||
import * as WebTorrent from 'webtorrent';
|
||||
|
||||
@Injectable()
|
||||
export class WebTorrentService {
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
<!-- opengraph tags -->
|
||||
<!-- Do not remove it! -->
|
||||
|
||||
<!-- TODO: bundle it with webpack when https://github.com/webpack/webpack/pull/1931 will be merged -->
|
||||
<!-- <script src="/client/assets/webtorrent/webtorrent.min.js"></script> -->
|
||||
|
||||
<link rel="icon" type="image/png" href="/client/assets/favicon.png" />
|
||||
|
||||
<!-- base url -->
|
||||
|
|
Loading…
Reference in New Issue