Fix keytar and bundling

This commit is contained in:
Shawn 2019-03-15 13:58:42 -05:00
parent a1f5572cb7
commit 3c3c12fa5d
5 changed files with 22 additions and 47 deletions

View file

@ -6,19 +6,19 @@
}, },
"files": [ "files": [
{ {
"from": "dist/electron", "from": "dist/electron/ui",
"to": "./", "to": "./",
"filter": ["!dist/!electron/**/*"] "filter": ["!dist/!electron/ui/**/*"]
},
{
"from": "dist/electron/webpack",
"to": "./",
"filter": ["!dist/!electron/!webpack/*.js", "!dist/!electron/!webpack/!static/**/*"]
}, },
{ {
"from": "dist/electron/static", "from": "dist/electron/static",
"to": "./", "to": "./",
"filter": ["!dist/!electron/static/**/*"] "filter": ["!dist/!electron/!static/index.html"]
},
{
"from": "dist/electron/ui",
"to": "./",
"filter": ["!dist/!electron/ui/**/*"]
} }
], ],
"publish": [ "publish": [

View file

@ -57,7 +57,7 @@
"express": "^4.16.4", "express": "^4.16.4",
"formik": "^0.10.4", "formik": "^0.10.4",
"hast-util-sanitize": "^1.1.2", "hast-util-sanitize": "^1.1.2",
"keytar": "^4.3.0", "keytar": "4.4.1",
"lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#f140db38dd73cead9e87549340fa9434da62ba8a", "lbry-redux": "lbryio/lbry-redux#f140db38dd73cead9e87549340fa9434da62ba8a",
"lbryinc": "lbryio/lbryinc#636f014f421827ab6b74caf334c364a362a1a099", "lbryinc": "lbryio/lbryinc#636f014f421827ab6b74caf334c364a362a1a099",
@ -122,7 +122,7 @@
"decompress": "^4.2.0", "decompress": "^4.2.0",
"del": "^3.0.0", "del": "^3.0.0",
"devtron": "^1.4.0", "devtron": "^1.4.0",
"electron": "^4.0.4", "electron": "4.1.0",
"electron-builder": "^20.38.4", "electron-builder": "^20.38.4",
"electron-devtools-installer": "^2.2.3", "electron-devtools-installer": "^2.2.3",
"electron-publisher-s3": "^20.8.1", "electron-publisher-s3": "^20.8.1",

View file

@ -1,4 +1,5 @@
const path = require('path'); const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge'); const merge = require('webpack-merge');
const { DefinePlugin, ProvidePlugin } = require('webpack'); const { DefinePlugin, ProvidePlugin } = require('webpack');
const { getIfUtils, removeEmpty } = require('webpack-config-utils'); const { getIfUtils, removeEmpty } = require('webpack-config-utils');

View file

@ -14,14 +14,10 @@ const mainConfig = {
}, },
output: { output: {
filename: '[name].js', filename: '[name].js',
path: __dirname + '/dist/electron', path: __dirname + '/dist/electron/webpack',
}, },
module: { module: {
rules: [ rules: [
{
test: /\.node$/,
use: 'node-loader',
},
{ {
test: /\.jsx?$/, test: /\.jsx?$/,
use: [ use: [
@ -43,17 +39,16 @@ const mainConfig = {
{ {
from: `${STATIC_ROOT}/`, from: `${STATIC_ROOT}/`,
to: `${DIST_ROOT}/electron/static/`, to: `${DIST_ROOT}/electron/static/`,
ignore: ['font/**/*', 'index.html'], ignore: ['font/**/*'],
},
{
from: `${STATIC_ROOT}/index.html`,
to: `${DIST_ROOT}/electron/index.html`,
}, },
]), ]),
], ],
devServer: { devServer: {
contentBase: path.join(__dirname, 'dist/electron'), contentBase: path.join(__dirname, 'dist/electron'),
}, },
externals: {
keytar: 'require("keytar")',
},
}; };
const renderConfig = { const renderConfig = {
@ -63,14 +58,10 @@ const renderConfig = {
}, },
output: { output: {
filename: '[name].js', filename: '[name].js',
path: __dirname + '/dist/electron', path: __dirname + '/dist/electron/webpack',
}, },
module: { module: {
rules: [ rules: [
{
test: /\.node$/,
use: 'node-loader',
},
{ {
test: /\.jsx?$/, test: /\.jsx?$/,
use: [ use: [
@ -87,23 +78,6 @@ const renderConfig = {
}, },
], ],
}, },
plugins: [
new CopyWebpackPlugin([
{
from: `${STATIC_ROOT}/`,
to: `${DIST_ROOT}/electron/static/`,
ignore: ['font/**/*', 'index.html', 'index.dev.html'],
},
{
from: `${STATIC_ROOT}/index.html`,
to: `${DIST_ROOT}/electron/index.html`,
},
{
from: `${STATIC_ROOT}/index.dev.html`,
to: `${DIST_ROOT}/electron/index.dev.html`,
},
]),
],
}; };
module.exports = [merge(baseConfig, mainConfig), merge(baseConfig, renderConfig)]; module.exports = [merge(baseConfig, mainConfig), merge(baseConfig, renderConfig)];

View file

@ -3568,10 +3568,10 @@ electron-window-state@^4.1.1:
jsonfile "^2.2.3" jsonfile "^2.2.3"
mkdirp "^0.5.1" mkdirp "^0.5.1"
electron@^4.0.4: electron@4.1.0:
version "4.0.6" version "4.1.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-4.0.6.tgz#f936772ddb5eaa026591ea14ef806e1385fbbda9" resolved "https://registry.yarnpkg.com/electron/-/electron-4.1.0.tgz#ecba9c83de271e8ba7637332ece9ed023c6ea3f0"
integrity sha512-r2ow/EmDibjoCNJp35mB1CcPs2xBF9fp2eoWuUOJmpVQyzdba6EnqsSD1BxwXzF9vQ5WkQ2UbfXBIvpomrdioQ== integrity sha512-q/yTi9dT5UEFK/s+vOQaHNkTHWiRK9kEBYVJt34nmWc9piW42hXT+nhKUEHHhccMPr3q18gG0iPZqeR+LG76ow==
dependencies: dependencies:
"@types/node" "^10.12.18" "@types/node" "^10.12.18"
electron-download "^4.1.0" electron-download "^4.1.0"
@ -5982,7 +5982,7 @@ kebab-case@^1.0.0:
resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.0.tgz#3f9e4990adcad0c686c0e701f7645868f75f91eb" resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.0.tgz#3f9e4990adcad0c686c0e701f7645868f75f91eb"
integrity sha1-P55JkK3K0MaGwOcB92RYaPdfkes= integrity sha1-P55JkK3K0MaGwOcB92RYaPdfkes=
keytar@^4.3.0: keytar@4.4.1:
version "4.4.1" version "4.4.1"
resolved "https://registry.yarnpkg.com/keytar/-/keytar-4.4.1.tgz#156af8a9b016bf118ee9948b02418c81d760a5ba" resolved "https://registry.yarnpkg.com/keytar/-/keytar-4.4.1.tgz#156af8a9b016bf118ee9948b02418c81d760a5ba"
integrity sha512-6xEe7ybXSR5EZC+z0GI2yqLYZjV1tyPQY2xSZ8rGsBxrrLEh8VR/Lfqv59uGX+I+W+OZxH0jCXN1dU1++ify4g== integrity sha512-6xEe7ybXSR5EZC+z0GI2yqLYZjV1tyPQY2xSZ8rGsBxrrLEh8VR/Lfqv59uGX+I+W+OZxH0jCXN1dU1++ify4g==