Skip to content

Commit

Permalink
Fix errors and resolve warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
orhoj committed Dec 3, 2021
1 parent 8762b03 commit 994ad44
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 106 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ storybook-static
app/1.preload.dev.worker.js
app/crypto.wasm
app/preload.dev.worker.js
app/pkg_index_js.preload.dev.worker.js

.idea
npm-debug.log.*
Expand Down
2 changes: 1 addition & 1 deletion app/app-dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
scripts.push('../dll/renderer.dev.dll.js');
// Dynamically insert the bundled app script in the renderer process
const port = 1212;
scripts.push(`http://localhost:${port}/renderer.dev.js`);
scripts.push(`http://localhost:${port}/dist/renderer.dev.js`);
if (scripts.length) {
document.write(
scripts
Expand Down
2 changes: 1 addition & 1 deletion configs/webpack.config.preload.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CheckNodeEnv('development');
DeleteSourceMaps();

module.exports = merge(baseConfig, assetsConfig, stylesConfig(true), {
mode: 'production',
mode: 'development',
target: 'electron-main',
entry: [
'core-js',
Expand Down
3 changes: 3 additions & 0 deletions configs/webpack.config.preload.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ module.exports = merge(baseConfig, assetsConfig, stylesConfig(true), {
'regenerator-runtime/runtime',
fromRoot('./app/preload/preload.ts'),
],
experiments: {
syncWebAssembly: true,
},
output: {
path: fromRoot('./app/dist'),
publicPath: './dist/',
Expand Down
51 changes: 3 additions & 48 deletions configs/webpack.config.renderer.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (process.env.NODE_ENV === 'production') {
}

const port = process.env.PORT || 1212;
const publicPath = `http://localhost:${port}/dist`;
const publicPath = `http://localhost:${port}/dist/`;
const dll = fromRoot('./dll');
const manifest = path.resolve(dll, 'renderer.json');
const requiredByDLLConfig = module.parent.filename.includes(
Expand Down Expand Up @@ -52,14 +52,13 @@ module.exports = merge(baseConfig, assetsConfig, stylesConfig(false), {
entry: [
'core-js',
'regenerator-runtime/runtime',
...(process.env.PLAIN_HMR ? [] : ['react-hot-loader/patch']),
`webpack-dev-server/client?http://localhost:${port}/`,
'webpack/hot/only-dev-server',
require.resolve('../app/index.tsx'),
],

output: {
publicPath: '/',
publicPath,
filename: 'renderer.dev.js',
library: {
type: 'umd',
Expand All @@ -74,31 +73,6 @@ module.exports = merge(baseConfig, assetsConfig, stylesConfig(false), {
alias: {
'react-dom': '@hot-loader/react-dom',
},
fallback: {
assert: require.resolve('assert'),
buffer: require.resolve('buffer'),
console: require.resolve('console-browserify'),
constants: require.resolve('constants-browserify'),
crypto: require.resolve('crypto-browserify'),
domain: require.resolve('domain-browser'),
events: require.resolve('events'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
os: require.resolve('os-browserify/browser'),
path: require.resolve('path-browserify'),
punycode: require.resolve('punycode'),
// process: require.resolve('process/browser'),
querystring: require.resolve('querystring-es3'),
stream: require.resolve('stream-browserify'),
string_decoder: require.resolve('string_decoder'),
sys: require.resolve('util'),
timers: require.resolve('timers-browserify'),
tty: require.resolve('tty-browserify'),
url: require.resolve('url'),
util: require.resolve('util'),
vm: require.resolve('vm-browserify'),
zlib: require.resolve('browserify-zlib'),
},
},
optimization: {
emitOnErrors: false,
Expand All @@ -116,18 +90,6 @@ module.exports = merge(baseConfig, assetsConfig, stylesConfig(false), {
Buffer: ['buffer/', 'Buffer'],
}),

/**
* Create global constants which can be configured at compile time.
*
* Useful for allowing different behaviour between development builds and
* release builds
*
* NODE_ENV should be production so that modules do not perform certain
* development checks
*
* By default, use 'development' as NODE_ENV. This can be overriden with
* 'staging', for example, by changing the ENV variables in the npm scripts
*/
new webpack.EnvironmentPlugin({
NODE_ENV: 'development',
}),
Expand All @@ -148,14 +110,7 @@ module.exports = merge(baseConfig, assetsConfig, stylesConfig(false), {
hot: true,
headers: { 'Access-Control-Allow-Origin': '*' },
static: {
// directory: path.join(__dirname, 'dist'),
// watch: true,
publicPath: '/',
// watchOptions: {
// aggregateTimeout: 300,
// ignored: /node_modules/,
// poll: 100,
// },
publicPath,
},
historyApiFallback: {
verbose: true,
Expand Down
13 changes: 4 additions & 9 deletions configs/webpack.config.renderer.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,11 @@ module.exports = merge(baseConfig, assetsConfig, stylesConfig(true), {
],
},

experiments: {
syncWebAssembly: true,
},

plugins: [
/**
* Create global constants which can be configured at compile time.
*
* Useful for allowing different behaviour between development builds and
* release builds
*
* NODE_ENV should be production so that modules do not perform certain
* development checks
*/
new webpack.EnvironmentPlugin({
NODE_ENV: 'production',
DEBUG_PROD: false,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
"jest": "^26.6.3",
"knex": "0.95.5",
"lint-staged": "^10.2.11",
"mini-css-extract-plugin": "^0.9.0",
"mini-css-extract-plugin": "^2.4.5",
"node-sass": "^4.14.1",
"opencollective-postinstall": "^2.0.3",
"optimize-css-assets-webpack-plugin": "^5.0.3",
Expand Down Expand Up @@ -244,7 +244,7 @@
"webpack": "^5.64.4",
"webpack-bundle-analyzer": "^3.8.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.6.0",
"webpack-dev-server": "4.6.0",
"webpack-merge": "^5.0.9",
"worker-loader": "^3.0.6",
"yargs": "^17.1.1"
Expand Down
52 changes: 7 additions & 45 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11853,7 +11853,7 @@ is-path-inside@^3.0.2:
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==

is-plain-obj@^1.0.0, is-plain-obj@^1.1.0:
is-plain-obj@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"
integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4=
Expand Down Expand Up @@ -13751,15 +13751,12 @@ mini-create-react-context@^0.4.0:
"@babel/runtime" "^7.12.1"
tiny-warning "^1.0.3"

mini-css-extract-plugin@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz#47f2cf07aa165ab35733b1fc97d4c46c0564339e"
integrity sha512-lp3GeY7ygcgAmVIcRPBVhIkf8Us7FZjA+ILpal44qLdSu11wmjKQ3d9k15lfD7pO4esu9eUIAW7qiYIBppv40A==
mini-css-extract-plugin@^2.4.5:
version "2.4.5"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.4.5.tgz#191d6c170226037212c483af1180b4010b7b9eef"
integrity sha512-oEIhRucyn1JbT/1tU2BhnwO6ft1jjH1iCX9Gc59WFMg0n5773rQU0oyQ0zzeYFFuBfONaRbQJyGoPtuNseMxjA==
dependencies:
loader-utils "^1.1.0"
normalize-url "1.9.1"
schema-utils "^1.0.0"
webpack-sources "^1.1.0"
schema-utils "^4.0.0"

minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
version "1.0.1"
Expand Down Expand Up @@ -14322,16 +14319,6 @@ normalize-selector@^0.2.0:
resolved "https://registry.yarnpkg.com/normalize-selector/-/normalize-selector-0.2.0.tgz#d0b145eb691189c63a78d201dc4fdb1293ef0c03"
integrity sha1-0LFF62kRicY6eNIB3E/bEpPvDAM=

[email protected]:
version "1.9.1"
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c"
integrity sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=
dependencies:
object-assign "^4.0.1"
prepend-http "^1.0.0"
query-string "^4.1.0"
sort-keys "^1.0.0"

normalize-url@^3.0.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559"
Expand Down Expand Up @@ -15671,11 +15658,6 @@ prelude-ls@~1.1.2:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=

prepend-http@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=

prepend-http@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
Expand Down Expand Up @@ -15959,14 +15941,6 @@ qs@~6.5.2:
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==

query-string@^4.1.0:
version "4.3.4"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb"
integrity sha1-u7aTucqRXCMlFbIosaArYJBD2+s=
dependencies:
object-assign "^4.1.0"
strict-uri-encode "^1.0.0"

querystring-es3@^0.2.0, querystring-es3@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73"
Expand Down Expand Up @@ -17616,13 +17590,6 @@ sockjs@^0.3.21:
uuid "^3.4.0"
websocket-driver "^0.7.4"

sort-keys@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad"
integrity sha1-RBttTTRnmPG05J6JIK37oOVD+a0=
dependencies:
is-plain-obj "^1.0.0"

source-list-map@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34"
Expand Down Expand Up @@ -17927,11 +17894,6 @@ stream-shift@^1.0.0:
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d"
integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==

strict-uri-encode@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=

[email protected]:
version "0.3.1"
resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da"
Expand Down Expand Up @@ -19909,7 +19871,7 @@ webpack-dev-middleware@^5.2.1:
range-parser "^1.2.1"
schema-utils "^4.0.0"

webpack-dev-server@^4.6.0:
[email protected]:
version "4.6.0"
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.6.0.tgz#e8648601c440172d9b6f248d28db98bed335315a"
integrity sha512-oojcBIKvx3Ya7qs1/AVWHDgmP1Xml8rGsEBnSobxU/UJSX1xP1GPM3MwsAnDzvqcVmVki8tV7lbcsjEjk0PtYg==
Expand Down

0 comments on commit 994ad44

Please sign in to comment.