Compare commits
10 Commits
0.12.2-1
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9809e6661 | ||
|
|
083151460a | ||
|
|
c8f97ef386 | ||
|
|
c9a22a5eaf | ||
|
|
f926732070 | ||
|
|
3fbe6e9d9b | ||
|
|
225230381f | ||
|
|
b58d3a1b8b | ||
|
|
ffedce4351 | ||
|
|
a4fdb67913 |
@@ -14,6 +14,7 @@ module.exports = {
|
||||
entry: [`${clientDir}/main.js`],
|
||||
output: {
|
||||
publicPath: '/app/',
|
||||
clean: true
|
||||
},
|
||||
|
||||
module: {
|
||||
|
||||
@@ -16,7 +16,8 @@ module.exports = merge(baseWpConfig, {
|
||||
devtool: 'inline-source-map',
|
||||
output: {
|
||||
path: `${publicDir}/app`,
|
||||
filename: 'bundle.js'
|
||||
filename: 'bundle.js',
|
||||
clean: true
|
||||
},
|
||||
|
||||
module: {
|
||||
@@ -38,6 +39,6 @@ module.exports = merge(baseWpConfig, {
|
||||
template: `${clientDir}/index.html.template`,
|
||||
filename: `${publicDir}/index.html`
|
||||
}),
|
||||
new CopyWebpackPlugin({patterns: [{from: `${clientDir}/assets/*`, to: `${publicDir}/`}]})
|
||||
new CopyWebpackPlugin({patterns: [{context: `${clientDir}/assets`, from: `${clientDir}/assets/*`, to: `${publicDir}/`}]})
|
||||
]
|
||||
});
|
||||
|
||||
@@ -18,7 +18,8 @@ module.exports = merge(baseWpConfig, {
|
||||
mode: 'production',
|
||||
output: {
|
||||
path: `${publicDir}/app_new`,
|
||||
filename: 'bundle.[contenthash].js'
|
||||
filename: 'bundle.[contenthash].js',
|
||||
clean: true
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
@@ -54,7 +55,7 @@ module.exports = merge(baseWpConfig, {
|
||||
filename: `${publicDir}/index.html`
|
||||
}),
|
||||
new CopyWebpackPlugin({patterns:
|
||||
[{from: `${clientDir}/assets/*`, to: `${publicDir}/`, context: `${clientDir}/assets` }]
|
||||
[{context: `${clientDir}/assets`, from: `${clientDir}/assets/*`, to: `${publicDir}/` }]
|
||||
}),
|
||||
new GenerateSW({
|
||||
cacheId: 'liberama',
|
||||
|
||||
24
package-lock.json
generated
24
package-lock.json
generated
@@ -6161,9 +6161,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/loader-utils": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
|
||||
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
|
||||
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"big.js": "^5.2.2",
|
||||
@@ -9654,9 +9654,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vue-style-loader/node_modules/loader-utils": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
|
||||
"integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz",
|
||||
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"big.js": "^5.2.2",
|
||||
@@ -15075,9 +15075,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"loader-utils": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
|
||||
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
|
||||
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"big.js": "^5.2.2",
|
||||
@@ -17615,9 +17615,9 @@
|
||||
}
|
||||
},
|
||||
"loader-utils": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
|
||||
"integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz",
|
||||
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"big.js": "^5.2.2",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
const https = require('https');
|
||||
const axios = require('axios');
|
||||
const utils = require('./utils');
|
||||
|
||||
@@ -16,6 +17,9 @@ class FileDownloader {
|
||||
'user-agent': userAgent,
|
||||
timeout: 300*1000,
|
||||
},
|
||||
httpsAgent: new https.Agent({
|
||||
rejectUnauthorized: false // решение проблемы 'unable to verify the first certificate' для некоторых сайтов с валидным сертификатом
|
||||
}),
|
||||
responseType: 'stream',
|
||||
};
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ class ReaderWorker {
|
||||
let convertFilename = '';
|
||||
|
||||
const overLoadMes = 'Слишком большая очередь загрузки. Пожалуйста, попробуйте позже.';
|
||||
const fileNotFoundMes = 'Файл не найден';
|
||||
const overLoadErr = new Error(overLoadMes);
|
||||
|
||||
let q = null;
|
||||
@@ -184,26 +185,33 @@ class ReaderWorker {
|
||||
})();
|
||||
|
||||
} catch (e) {
|
||||
log(LM_ERR, `url: ${url}, downloadedFilename: ${downloadedFilename}`);
|
||||
log(LM_ERR, e.stack);
|
||||
let mes = e.message.split('|FORLOG|');
|
||||
if (mes[1])
|
||||
log(LM_ERR, mes[0] + mes[1]);
|
||||
log(LM_ERR, `downloadedFilename: ${downloadedFilename}`);
|
||||
|
||||
mes = mes[0];
|
||||
if (mes == 'abort')
|
||||
mes = overLoadMes;
|
||||
if (mes.indexOf('ENOTDIR') >= 0)
|
||||
mes = fileNotFoundMes;
|
||||
|
||||
wState.set({state: 'error', error: mes});
|
||||
} finally {
|
||||
//clean
|
||||
if (q)
|
||||
q.ret();
|
||||
if (decompDir)
|
||||
await fs.remove(decompDir);
|
||||
if (downloadedFilename && !isUploaded)
|
||||
await fs.remove(downloadedFilename);
|
||||
if (convertFilename)
|
||||
await fs.remove(convertFilename);
|
||||
try {
|
||||
if (q)
|
||||
q.ret();
|
||||
if (decompDir)
|
||||
await fs.remove(decompDir);
|
||||
if (downloadedFilename && !isUploaded)
|
||||
await fs.remove(downloadedFilename);
|
||||
if (convertFilename)
|
||||
await fs.remove(convertFilename);
|
||||
} catch (e) {
|
||||
log(LM_ERR, `Remove error: ${e.stack}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user