@leogps/file-uploader 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -11
- package/dist/client/index.html +1 -1
- package/dist/client/{main.cb411c3ff6063891b944.bundle.js → main.5b512c69d6a84b326aa0.bundle.js} +395 -321
- package/dist/index.js +1 -1
- package/package.json +5 -2
- package/scripts/inject-version.js +23 -0
- package/src/globals.ts +57 -29
- package/src/index.ts +59 -37
- package/src/routes/config.ts +15 -0
- package/src/routes/upload.ts +6 -7
- package/src/routes/uploadChunk.ts +3 -3
- package/src/routes/uploadInit.ts +6 -7
- package/src-client/entrypoint.ts +127 -23
- package/src-client/progress-handler.ts +1 -1
- package/tsconfig.dev.json +11 -0
- package/webpack-client.common.js +0 -5
- package/webpack-client.dev.js +8 -0
- package/webpack-client.prod.js +8 -0
- package/webpack.config.js +6 -2
|
@@ -213,7 +213,7 @@ export class ProgressHandler {
|
|
|
213
213
|
<b>|</b> Uploaded: ${uploaded}/${totalChunks}`],
|
|
214
214
|
["Speed", `${prettyBytes(ProgressUtils.calculateTransferRate(progress))}/s`],
|
|
215
215
|
["Status", `${progress.lastState || "-"}`],
|
|
216
|
-
["Progress", `${progressPercent}%`],
|
|
216
|
+
["Progress", `${progressPercent.toFixed(2)}%`],
|
|
217
217
|
];
|
|
218
218
|
|
|
219
219
|
if (progress.completed) {
|
package/webpack-client.common.js
CHANGED
package/webpack-client.dev.js
CHANGED
|
@@ -7,6 +7,14 @@ module.exports = webpackMerge.merge(common, {
|
|
|
7
7
|
devtool: 'eval',
|
|
8
8
|
module: {
|
|
9
9
|
rules: [
|
|
10
|
+
{
|
|
11
|
+
test: /\.tsx?$/,
|
|
12
|
+
loader: "ts-loader",
|
|
13
|
+
exclude: /node_modules/,
|
|
14
|
+
options: {
|
|
15
|
+
configFile: "tsconfig.dev.json"
|
|
16
|
+
},
|
|
17
|
+
},
|
|
10
18
|
{
|
|
11
19
|
test: /\.css$/,
|
|
12
20
|
use: [
|
package/webpack-client.prod.js
CHANGED
|
@@ -9,6 +9,14 @@ module.exports = webpackMerge.merge(common,{
|
|
|
9
9
|
mode: 'production',
|
|
10
10
|
module: {
|
|
11
11
|
rules: [
|
|
12
|
+
{
|
|
13
|
+
test: /\.tsx?$/,
|
|
14
|
+
loader: "ts-loader",
|
|
15
|
+
exclude: /node_modules/,
|
|
16
|
+
options: {
|
|
17
|
+
configFile: "tsconfig.json"
|
|
18
|
+
},
|
|
19
|
+
},
|
|
12
20
|
{
|
|
13
21
|
test: /\.css$/,
|
|
14
22
|
use: [
|
package/webpack.config.js
CHANGED
|
@@ -4,6 +4,7 @@ const webpack = require('webpack');
|
|
|
4
4
|
const mode = process.env.NODE_ENV ? process.env.NODE_ENV : 'development'
|
|
5
5
|
console.log("Mode chosen for webpack: " + mode)
|
|
6
6
|
const devtool = mode === 'development' ? 'eval': 'nosources-source-map'
|
|
7
|
+
const tsconfigFile = mode === 'development' ? 'tsconfig.dev.json' : 'tsconfig.json'
|
|
7
8
|
module.exports = {
|
|
8
9
|
mode: mode,
|
|
9
10
|
devtool: devtool,
|
|
@@ -19,8 +20,11 @@ module.exports = {
|
|
|
19
20
|
rules: [
|
|
20
21
|
{
|
|
21
22
|
test: /\.tsx?$/,
|
|
22
|
-
|
|
23
|
-
exclude: /node_modules
|
|
23
|
+
loader: "ts-loader",
|
|
24
|
+
exclude: /node_modules/,
|
|
25
|
+
options: {
|
|
26
|
+
configFile: tsconfigFile
|
|
27
|
+
},
|
|
24
28
|
}
|
|
25
29
|
]
|
|
26
30
|
},
|