firtoz / react-three-renderer

Render into a three.js canvas using React.
https://toxicfork.github.com/react-three-renderer-example/
MIT License
1.49k stars 155 forks source link

.babelrc instead of inline in package.json #200

Open ashl1 opened 6 years ago

ashl1 commented 6 years ago

The case

Solution we use

Problem

While Babel is run for files provided by npm, the Babel configuration is presented in the package.json file. But the already babelified js file will be used. Threfore our (external) Babel tries to use (internal) Babel config. The configuration between your package and our Babel might be different.

Decision

Could you take the Babel settings out and put them on separate .babelrc file and add the file to .npmignore? If user wants to develop an app he will use Git sources with .babelrc. If he simply wants to use the builded form of your package, this won't be affected by the internal Babel settings.

toxicFork commented 6 years ago

That sounds reasonable, do you have an example set up so I can try to see if I did it right?

On Tue, Oct 17, 2017, 21:18 Alexey Shildyakov notifications@github.com wrote:

The case

  • some of libs in npm registry provides only ES6 builds
  • we want to support browsers with ES5 builds

Solution we use

  • enable babel for node_modules directory

Problem

While Babel is run for files provided by npm, the Babel configuration is presented in the package.json file. But the already babelified js file will be used. Threfore our (external) Babel tries to use (internal) Babel config. The configuration between your package and our Babel might be different. Decision

Could you take the Babel settings out and put them on separate .babelrc file and add the file to .npmignore? If user wants to develop an app he will use Git sources with .babelrc. If he simply wants to use the builded form of your package, this won't be affected by the internal Babel settings.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/toxicFork/react-three-renderer/issues/200, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0iLQ-gWZ7JWBwDn1lRMsS9bw7Gq3SGks5stQtAgaJpZM4P8wbf .

ashl1 commented 6 years ago

FYI https://philipwalton.com/articles/deploying-es2015-code-in-production-today/ I can make a PR tommorow