rserota / wad

Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
MIT License
1.9k stars 160 forks source link

including a compiled ES5 Version in the build folder? #87

Closed frastlin closed 6 years ago

frastlin commented 6 years ago

Hello, I am trying to build my app with Uglify.js in create-react-app, but I get the following error:

Failed to minify the code from this file:

        ./node_modules/web-audio-daw/build/wad.js:3093

Read more here: http://bit.ly/2tRViJ9

the create-react-app documentation says:

Some third-party packages don't compile their code to ES5 before publishing to npm. This often causes problems in the ecosystem because neither browsers (except for most modern versions) nor some tools currently support all ES6 features. We recommend to publish code on npm as ES5 at least for a few more years.

To resolve this:

  1. Open an issue on the dependency's issue tracker and ask that the package be published pre-compiled. • Note: Create React App can consume both CommonJS and ES modules. For Node.js compatibility, it is recommended that the main entry point is CommonJS. However, they can optionally provide an ES module entry point with the module field in package.json. Note that even if a library provides an ES Modules version, it should still precompile other ES6 features to ES5 if it intends to support older browsers.
  2. Fork the package and publish a corrected version yourself.

  3. If the dependency is small enough, copy it to your src/ folder and treat it as application code. In the future, we might start automatically compiling incompatible third-party modules, but it is not currently supported. This approach would also slow down the production builds.

It would be nice if WAD had ES5 compiled in the distro.

rserota commented 6 years ago

Try it again now. Wad.js should be es5 compatible in 4.0.1, so it should work fine with create-react-app.

frastlin commented 6 years ago

Perfect it works thank you! BTW, WAD is amazing, I use it in every audio app I build.

frastlin commented 6 years ago

Version 4.0.1 worked, but I just updated to 4.1.2 and got the following error with the build process:

Failed to compile.

Failed to minify the code from this file:

        ./node_modules/web-audio-daw/build/wad.js:2673

Read more here: http://bit.ly/2tRViJ9

This also happened in version 4.1.1.

rserota commented 6 years ago

Oops. This should be fixed in the latest version.