Browse Source

@uppy/image-editor: remove CJS-interop hack in the source code (#3778)

Antoine du Hamel 2 years ago
parent
commit
2cbd762627
2 changed files with 2 additions and 5 deletions
  1. 1 0
      bin/build-lib.js
  2. 1 5
      packages/@uppy/image-editor/src/Editor.jsx

+ 1 - 0
bin/build-lib.js

@@ -25,6 +25,7 @@ const META_FILES = [
 // So, if we are being built using rollup, this require() won't have a `.default` property.
 const esPackagesThatNeedSpecialTreatmentForRollupInterop = [
   'get-form-data',
+  'cropperjs',
 ]
 
 function lastModified (file, createParentDir = false) {

+ 1 - 5
packages/@uppy/image-editor/src/Editor.jsx

@@ -1,10 +1,6 @@
-import CropperImport from 'cropperjs'
+import Cropper from 'cropperjs'
 import { h, Component } from 'preact'
 
-// @TODO A silly hack that we can get rid of when we start publishing ESM to the npm package.
-// eslint-disable-next-line no-underscore-dangle
-const Cropper = CropperImport.__esModule ? CropperImport.default : CropperImport
-
 export default class Editor extends Component {
   constructor (props) {
     super(props)