Open miliu99 opened 7 years ago
Same issue. Using webpack and "ng2-img-cropper": "^0.8.6"
Hello, I am going to need more info on this. Tried with a fork of: https://github.com/AngularClass/angular2-webpack-starter
and worked perfectly:
here is a gist: https://gist.github.com/cstefanache/8c5590afedba56d55f84f62bdecba269
Hi.. I have same issue "Unexpected token export" with webpack. This library works perfectly fine with systemJs. Please suggest a possible solution.
Thanks in advance :)
Try angular2-img-cropper@0.8.1, working for me. 0.8.6 doesn't, probably because of #148.
The error I get with angular2-img-cropper@0.8.6 is Processing of node_modules/ng2-img-cropper/index.js failed. SyntaxError: 'import' and 'export' may only appear at the top level (6:0)
I'm using brunch http://brunch.io/.
do you have babel-preset-es2015 preset for babel installed?
Yes I had it, but because of this bug I removed babel to be sure it wasn't involved. And I still had the upper error message.
I'll try to do another release in few minutes with another trial
I will test it for sure.
OK I was probably wrong about #148, because angular2-img-cropper@0.8.3 is working. But not >= 0.8.4.
I am going to try to publish it with commonjs as module and see if it works edit: problem is that if I am going to introduce .ts files again people will start complaining from the other side!
can you give it a try? 0.8.8 published with tree-shaking & all
Perfect with 0.8.8 :+1:
Will close if the rest of the people will agree with you. Thank you for your help
Thank you a lot for angular2-img-cropper, you saved me a lot of work!
Hehe, glad to help. I am going to add more features soon - the irony is that I am not using Angular2 - just needed a cropper for a test of mine
I'm using webpack for my project. npm start has no error, but the brower console shows
Clicking main.js, it points to:
eval("// core\nexport { ImageCropperModule } from './src/imageCropperModule';\nexport { ImageCropperComponent } from './src/imageCropperComponent';\n// extra classes\nexport { ImageCropper } from './src/imageCropper';\nexport { CropperSettings } from './src/cropperSettings';\nexport { CropperDrawSettings } from './src/cropperDrawSettings';\n// models\nexport { Bounds } from './src/model/bounds';\nexport { CropPosition } from './src/model/cropPosition';\n//# sourceMappingURL=index.js.map\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9+L25nMi1pbWctY3JvcHBlci9pbmRle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