-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mjs couse trouble in create-react-app #2
Comments
Ok it's caused by facebook/create-react-app#3520 |
create-react-app Failed to compile. |
from the readme: |
@GrosSacASac Sure I did that, and able to run it on |
Is there way I can view your project? This honestly looks specific to create-react-app, but I'm willing to dig deeper if I can reproduce it on my machine. Also, it looks like the ticket you linked for create-react-app has been merged. Have you updated it to see if it fixes your issue? |
But when I did what https://github.com/facebookincubator/create-react-app/pull/3537/files said, building it will result in: yarn build
yarn run v1.3.2
$ node scripts/build.js
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/collisions/src/Collisions.mjs:12
Read more here: http://bit.ly/2tRViJ9
error Command failed with exit code 1. I think just like what http://bit.ly/2tRViJ9 said, at this early point, package publish to npm probably should still be ES5 ... Though I don't quite understand why .mjs file can't be minified. |
to minify ES6+ file use uglifyjs harmony branch https://github.com/mishoo/UglifyJS2/tree/harmony |
It throws
Unhandled Rejection (TypeError): __WEBPACK_IMPORTED_MODULE_1_collisions___default.a is not a constructor
If I
import Collisions, { Circle, Polygon } from 'collisions';
And
console.log(Collisions)
gives/static/media/Collisions.c776ea0e.mjs
The text was updated successfully, but these errors were encountered: