Skip to content
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

Don't publish .babelrc file #106

Merged
merged 1 commit into from
Jan 23, 2018
Merged

Conversation

oligot
Copy link
Contributor

@oligot oligot commented Jan 23, 2018

More and more npm packages contain ES2015+ code.
As discussed in this AMA, this causes a lot of troubles (Uglify and old browsers) for people.

One possible solution is to transpile external dependencies, as discussed in this issue on create-react-app and implemented in this pull request.

This doesn't currently work with Webslides as the .babelrc file is published on npm.
Here is a small repo demonstrating the bug.
Running npm run build results in this error

ERROR in ./node_modules/webslides/static/js/webslides.js
Module build failed: Error: Couldn't find preset "es2015" relative to directory ".../webslides-babelrc/node_modules/webslides"

By adding the .babelrc file to .npmignore, and removing the babel config in the package.json file, the bug would go away once a new version of Webslides is published.

This is basically the same PR as done for v-tooltip.

More and more npm packages contain ES2015+ code.
As discussed in [this AMA](sindresorhus/ama#446), this causes a lot of troubles (Uglify and old browsers) for people.

One possible solution is to transpile external dependencies, as discussed in [this issue on create-react-app](facebook/create-react-app#1125) and implemented in [this pull request](facebook/create-react-app#3776).

This doesn't currently work with Webslides as the .babelrc file is published on npm.
Here is a [small repo demonstrating the bug](https://github.com/oligot/webslides-babelrc).
Running `npm run build` results in this error

```
ERROR in ./node_modules/webslides/static/js/webslides.js
Module build failed: Error: Couldn't find preset "es2015" relative to directory ".../webslides-babelrc/node_modules/webslides"
```

By adding the .babelrc file to .npmignore, and removing the babel config in the _package.json_ file, the bug would go away once a new version of Webslides is published.

This is basically the same PR as done for [v-tooltip](Akryum/floating-vue#90).
@codecov
Copy link

codecov bot commented Jan 23, 2018

Codecov Report

Merging #106 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #106   +/-   ##
=======================================
  Coverage   90.17%   90.17%           
=======================================
  Files          19       19           
  Lines         641      641           
  Branches      128      128           
=======================================
  Hits          578      578           
  Misses         52       52           
  Partials       11       11

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea0f2cb...2671680. Read the comment docs.

@Antonio-Laguna
Copy link
Member

Hey @oligot !

Thanks for taking the time and noticing this. I don't have much experience with webpack, I'm someone with more experience caught this!

Hoping to release soon 1.6

@Antonio-Laguna Antonio-Laguna merged commit 9a2dfe0 into webslides:master Jan 23, 2018
@oligot oligot deleted the no-babelrc branch January 23, 2018 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants