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 #90

Merged
merged 1 commit into from
Jan 23, 2018
Merged

Don't publish .babelrc file #90

merged 1 commit into from
Jan 23, 2018

Conversation

oligot
Copy link
Contributor

@oligot oligot commented Jan 17, 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 v-tooltip 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/v-tooltip/dist/v-tooltip.esm.js
Module build failed: Error: Couldn't find preset "stage-0" relative to directory ".../v-tooltip-babelrc/node_modules/v-tooltip"

By adding the .babelrc file to .npmignore, the bug would go away once a new version of v-tooltip is published.

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 v-tooltip as the .babelrc file is
published on npm.
Here is a [small repo demonstrating the bug](https://github.com/oligot/v-tooltip-babelrc).
Running `npm run build` results in this error

```
ERROR in ./node_modules/v-tooltip/dist/v-tooltip.esm.js
Module build failed: Error: Couldn't find preset "stage-0" relative to directory ".../v-tooltip-babelrc/node_modules/v-tooltip"
```

By adding the .babelrc file to .npmignore, the bug would go away once a
new version of v-tooltip is published.
@Akryum Akryum merged commit 9c8ab4d into Akryum:master Jan 23, 2018
@Akryum
Copy link
Owner

Akryum commented Jan 23, 2018

Thanks for your PR! 👍

@oligot oligot deleted the no-babelrc branch January 23, 2018 08:19
oligot added a commit to oligot/WebSlides that referenced this pull request Jan 23, 2018
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).
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.

None yet

2 participants