diff --git a/package.json b/package.json index 630656cf5..dccc9bd29 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "compile": "cross-env NODE_ENV=production yarn compile:electron && cross-env NODE_ENV=production yarn compile:web", "dev": "yarn dev:electron", "dev:electron": "cross-env NODE_ENV=development node ./src/platforms/electron/devServer.js", - "dev:web": "webpack-dev-server --open --hot --progress --config webpack.web.config.js", + "dev:web": "NODE_ENV=development webpack-dev-server --open --hot --progress --config webpack.web.config.js", "dev:internal-apis": "LBRY_API_URL='http://localhost:9090' yarn dev:electron", "run:web": "cross-env NODE_ENV=production yarn compile:web && node ./dist/web/server.js", "pack": "electron-builder --dir", diff --git a/src/ui/component/viewers/audioVideoViewer.jsx b/src/ui/component/viewers/audioVideoViewer.jsx index 031f989cb..afd3d3950 100644 --- a/src/ui/component/viewers/audioVideoViewer.jsx +++ b/src/ui/component/viewers/audioVideoViewer.jsx @@ -2,11 +2,9 @@ import type { Claim } from 'types/claim'; import React from 'react'; import { stopContextMenu } from 'util/context-menu'; -import( - /* webpackChunkName: "videojs" */ - /* webpackPreload: true */ - 'video.js/dist/video-js.css' -); +import(/* webpackChunkName: "videojs" */ +/* webpackPreload: true */ +'video.js/dist/video-js.css'); type Props = { source: { @@ -23,8 +21,7 @@ class AudioVideoViewer extends React.PureComponent { player: ?{ dispose: () => void }; componentDidMount() { - const me = this; - const { contentType, poster, claim } = me.props; + const { contentType, poster, claim } = this.props; const path = `https://api.lbry.tv/content/claims/${claim.name}/${claim.claim_id}/stream.mp4`; const sources = [ @@ -42,13 +39,11 @@ class AudioVideoViewer extends React.PureComponent { sources, }; - import( - /* webpackChunkName: "videojs" */ - /* webpackMode: "lazy" */ - /* webpackPreload: true */ - 'video.js' - ).then((videojs) => { - me.player = videojs(me.videoNode, videoJsOptions, () => {}); + import(/* webpackChunkName: "videojs" */ + /* webpackMode: "lazy" */ + /* webpackPreload: true */ + 'video.js').then(videojs => { + this.player = videojs.default(this.videoNode, videoJsOptions, () => {}); }); } diff --git a/webpack.base.config.js b/webpack.base.config.js index e0d1f8278..3135906af 100644 --- a/webpack.base.config.js +++ b/webpack.base.config.js @@ -14,7 +14,7 @@ const UI_ROOT = path.resolve(__dirname, 'src/ui/'); const STATIC_ROOT = path.resolve(__dirname, 'static/'); const DIST_ROOT = path.resolve(__dirname, 'dist/'); -console.log(ifProduction('production', 'development')) +console.log(ifProduction('production', 'development')); let baseConfig = { mode: ifProduction('production', 'development'), @@ -84,7 +84,7 @@ let baseConfig = { plugins: [ new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), new webpack.EnvironmentPlugin(['NODE_ENV']), - new BundleAnalyzerPlugin(), + // new BundleAnalyzerPlugin(), new ProvidePlugin({ i18n: ['i18n', 'default'], __: ['i18n/__', 'default'], diff --git a/yarn.lock b/yarn.lock index b0798d2f2..7572faae7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4945,6 +4945,11 @@ graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1. resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= +gud@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0" + integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw== + gzip-size@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.0.0.tgz#a55ecd99222f4c48fd8c01c625ce3b349d0a0e80"