diff --git a/package.json b/package.json index c11b47b..5c081fd 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "author": "Kyle Bebak <kylebebak@gmail.com>", "description": "React file dropzone and uploader: fully customizable, progress indicators, upload cancellation and restart, zero deps and excellent TypeScript support", "main": "./dist/react-dropzone-uploader.js", - "types": "./dist/Dropzone.tsx", + "types": "./dist/Dropzone.d.ts", "keywords": [ "react", "react-component", @@ -68,7 +68,7 @@ } }, "scripts": { - "build": "rm dist/* && tsc && NODE_ENV=production webpack --config webpack.build.config.js && cp src/styles.css dist/styles.css && cp src/*.ts* dist", + "build": "rm -f dist/* && tsc && NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production webpack --config webpack.build.config.js && cp src/styles.css dist/styles.css", "dev": "tsc -w -p tsconfig.dev.json & webpack-dev-server --config webpack.config.js --mode development --open", "styleguide": "tsc -w & styleguidist server", "build-styleguide": "tsc && styleguidist build", diff --git a/src/Dropzone.tsx b/src/Dropzone.tsx index da29a80..1809090 100644 --- a/src/Dropzone.tsx +++ b/src/Dropzone.tsx @@ -501,7 +501,11 @@ class Dropzone extends React.Component<IDropzoneProps, { active: boolean; dragge try { params = await getUploadParams(fileWithMeta) } catch (e) { - console.error('Error Upload Params', e.stack) + if (e instanceof Error) { + console.error('Error Upload Params', e.stack) + return; + } + console.error('Error Upload Params', e) } if (params === null) return const { url, method = 'POST', body, fields = {}, headers = {}, meta: extraMeta = {} } = params diff --git a/tsconfig.json b/tsconfig.json index 193b451..5ff60b6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,8 @@ "skipLibCheck": true, "noUnusedLocals": true, "noUnusedParameters": true, + "declaration": true, + "outDir": "dist", "strict": true }, "include": ["src/*.tsx", "src/*.ts"], diff --git a/webpack.build.config.js b/webpack.build.config.js index 6636b27..31d0fef 100644 --- a/webpack.build.config.js +++ b/webpack.build.config.js @@ -18,7 +18,7 @@ function createConfig(entry, output) { rules: [ { test: /\.js?$/, - exclude: /node_modules/, + exclude: [/node_modules/, /src\/*.tsx/], use: 'babel-loader', }, {