use prod build for web

This commit is contained in:
Sean Yesmunt 2019-03-08 19:19:29 -05:00
parent 8ee1d2319d
commit 9c70921e2b
6 changed files with 39 additions and 12 deletions

View file

@ -23,11 +23,11 @@
"compile:electron": "webpack --progress --config webpack.electron.config.js",
"compile:web": "webpack --config webpack.web.config.js",
"compile": "yarn compile:electron && yarn compile:web",
"dev:electron": "webpack-dev-server --hot --progress --config webpack.electron.config.js",
"dev:web": "webpack-dev-server --open --hot --progress --config webpack.web.config.js",
"dev:electron": "cross-env NODE_ENV=development webpack-dev-server --hot --progress --config webpack.electron.config.js",
"dev:web": "cross-env NODE_ENV=development webpack-dev-server --open --hot --progress --config webpack.web.config.js",
"dev:internal-apis": "LBRY_API_URL='http://localhost:8080' yarn dev:electron",
"run:electron": "electron ./dist/electron/main.js",
"run:web": "yarn compile:web && node ./dist/web/server.js",
"run:electron": "cross-env NODE_ENV=development electron ./dist/electron/main.js",
"run:web": "cross-env NODE_ENV=production yarn compile:web && node ./dist/web/server.js",
"pack": "electron-builder --dir",
"dist": "electron-builder",
"build": "yarn compile && electron-builder build",
@ -112,6 +112,7 @@
"babel-loader": "^8.0.5",
"babel-plugin-add-module-exports": "^1.0.0",
"copy-webpack-plugin": "^4.6.0",
"cross-env": "^5.2.0",
"css-loader": "^2.1.0",
"decompress": "^4.2.0",
"del": "^3.0.0",
@ -146,6 +147,7 @@
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"webpack": "^4.28.4",
"webpack-config-utils": "^2.3.1",
"webpack-dev-middleware": "^3.6.0",
"webpack-dev-server": "^3.1.14",
"webpack-merge": "^4.2.1",

View file

@ -38,7 +38,6 @@ export default class ErrorBoundary extends React.Component<Props, State> {
}
render() {
console.log('app.env', app.env);
if (this.state.hasError) {
return (
<div className="load-screen">

View file

@ -34,7 +34,6 @@ class LoadScreen extends React.PureComponent<Props> {
<h3>{__('Uh oh. Sean must have messed something up. Try refreshing to fix it.')}</h3>
<div className="load-screen__actions">
<Button
disabled
label="Refresh"
button="link"
className="load-screen__button"

View file

@ -92,9 +92,6 @@
}
}
.button--link {
}
.button--selected {
font-weight: 800;
color: $lbry-teal-5;

View file

@ -1,14 +1,17 @@
const path = require('path');
const merge = require('webpack-merge');
const { DefinePlugin, ProvidePlugin } = require('webpack');
const { getIfUtils, removeEmpty } = require('webpack-config-utils');
const { ifProduction } = getIfUtils(process.env.NODE_ENV);
const UI_ROOT = path.resolve(__dirname, 'src/ui/');
const STATIC_ROOT = path.resolve(__dirname, 'static/');
const DIST_ROOT = path.resolve(__dirname, 'dist/');
const baseConfig = {
mode: 'development',
devtool: 'eval-source-map',
mode: ifProduction('production', 'development'),
devtool: ifProduction('source-map', 'eval-source-map'),
node: {
__dirname: false,
},

View file

@ -2641,6 +2641,14 @@ crocket@^0.9.11:
dependencies:
xpipe "*"
cross-env@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
integrity sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==
dependencies:
cross-spawn "^6.0.5"
is-windows "^1.0.0"
cross-spawn@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982"
@ -5653,7 +5661,7 @@ is-whitespace-character@^1.0.0:
resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.2.tgz#ede53b4c6f6fb3874533751ec9280d01928d03ed"
integrity sha512-SzM+T5GKUCtLhlHFKt2SDAX2RFzfS6joT91F2/WSi9LxgFdsnhfPK/UIA+JhRR2xuyLdrCys2PiFDrtn1fU5hQ==
is-windows@^1.0.1, is-windows@^1.0.2:
is-windows@^1.0.0, is-windows@^1.0.1, is-windows@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==
@ -8246,6 +8254,11 @@ qs@6.5.2, qs@~6.5.2:
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
qs@^6.5.2:
version "6.6.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.6.0.tgz#a99c0f69a8d26bf7ef012f871cdabb0aee4424c2"
integrity sha512-KIJqT9jQJDQx5h5uAVPimw6yVg2SekOKu959OCtktD3FjzbpvaPr8i4zzg07DOMz+igA4W/aNM7OV8H37pFYfA==
query-string@^4.1.0:
version "4.3.4"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb"
@ -10708,6 +10721,20 @@ webpack-cli@^3.2.1:
v8-compile-cache "^2.0.2"
yargs "^12.0.4"
webpack-combine-loaders@2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/webpack-combine-loaders/-/webpack-combine-loaders-2.0.4.tgz#27814d52b8329ed6565be39009aac76361e7e22c"
integrity sha512-5O5PYVE5tZ3I3uUm3QB7niLEJzLketl8hvAcJwa4YmwNWS/vixfVsqhtUaBciP8J4u/GwIHV52d7kkgZJFvDnw==
dependencies:
qs "^6.5.2"
webpack-config-utils@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/webpack-config-utils/-/webpack-config-utils-2.3.1.tgz#a51826ddd4de26c10dfdb81cbff8aac0debb0a36"
integrity sha512-0uC5uj7sThFTePTQjfpe5Wqcbw3KSCxqswOmW96lwk2ZI2CU098rWY2ZqOVGJQYJ3hfEltmjcLNkKutw8LJAlg==
dependencies:
webpack-combine-loaders "2.0.4"
webpack-dev-middleware@^3.5.1, webpack-dev-middleware@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.6.0.tgz#71f1b04e52ff8d442757af2be3a658237d53a3e5"