Slice a portion of file content after webpack compression and minification
sushilprj opened this issue · comments
I am using webpack 4+ and react application with react-s3-upload library. When I compile my react application, it's compiled successfully without any issue but a portion of the file content skipped during this process. Here is the file -
https://github.com/odysseyscience/react-s3-uploader/blob/master/ReactS3Uploader.js
and this portion of file content skipped.
propTypes: { signingUrl: PropTypes.string, getSignedUrl: PropTypes.func, preprocess: PropTypes.func, onSignedUrl: PropTypes.func, onProgress: PropTypes.func, onFinish: PropTypes.func, onError: PropTypes.func, signingUrlMethod: PropTypes.string, signingUrlHeaders: PropTypes.oneOfType([ PropTypes.object, PropTypes.func ]), signingUrlQueryParams: PropTypes.oneOfType([ PropTypes.object, PropTypes.func ]), signingUrlWithCredentials: PropTypes.bool, uploadRequestHeaders: PropTypes.object, contentDisposition: PropTypes.string, server: PropTypes.string, scrubFilename: PropTypes.func, s3path: PropTypes.string, inputRef: PropTypes.func, autoUpload: PropTypes.bool }
I am using the terser library to minify JS file.
Please let me know if you need more insight on this.
I get the same issue.
I finished by wrap ReactS3Uploader
class to redefine propTypes
:
const MyUploader = ReactS3Uploader
MyUploader.propTypes = {
// Copy propTypes from here : https://github.com/odysseyscience/react-s3-uploader/blob/master/ReactS3Uploader.js#L12
}
export default MyUploader
Thanks @cyrill62 for responding.