Skip to content

Consider transpiling /lib/ to ES5 for use as a library #4887

@jaredp

Description

@jaredp

The create-react-app project recommends publishing all modules to npm as ES5. See https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify.

/lib/ not being ES5 is causing a problem when I try to use coffeescript as a library in my create-react-app based webapp. To be clear, I'm making something like the "Try Coffeescript" tab on coffeescript.org, not just trying to use Coffeescript to write the app itself in.

To reproduce the issue, see https://github.com/jaredp/cs2-as-a-library-demo. The commits are:

  1. a clean create-react-app + npm eject
  2. adding support for coffeescript + coffee-loader in webpack
  3. using Coffeescript as a library to live compile CS2 code for the user of cs2-as-a-library-demo

At the 3rd commit, npm build fails, even though npm start (dev mode) works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions