Code Monkey home page Code Monkey logo

Comments (5)

gaearon avatar gaearon commented on May 10, 2024 1

This is fixed in 2.0.
https://reactjs.org/blog/2018/10/01/create-react-app-v2.html

from pts.

williamngan avatar williamngan commented on May 10, 2024

Yes, I think the problem is that "create-react-app" uses UglifyJS, which doesn't support es6 modules.

I guess there're two options:

  • Compile everything to es5 first and then minify. Probably will need the babel builtin-extend plugin or something similar for Array subclasses that were used in Pts

  • Option 2: Use a different minify tool such as babili or uglify-es. Note that Pts uses Babili to minify, but there seems to a mobile webkit bug that prevents the minified code to run in mobile browser. Not sure if it's now fixed. FYI.

I was hoping we won't need to investigate a es5 compile workflow, but it seems like we'll need to. These build processes are really a big headache :)

If you get it to work in es5 minify, please post your suggestions here. Thanks!

from pts.

tofuness avatar tofuness commented on May 10, 2024

This will be fixed in create-react-app 2.x.

Roadmap: facebook/create-react-app#3618
Merge: facebook/create-react-app#3618

from pts.

williamngan avatar williamngan commented on May 10, 2024

Starting with v0.6.1, you should be able to make an es5 build in create-react-app by using:

import {Pt} from 'pts/dist/es5.js'; // use this for es5 build

Alternatively, you can use a newer companion tools such as neutrino.js instead of create-react-app. Take a look at the updated pts-react-example

from pts.

williamngan avatar williamngan commented on May 10, 2024

Awesome! We'll test Pts using create-react-app 2.0 and update the docs soon. Thanks @gaearon

from pts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.