1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-08-25 22:20:46 +02:00

Don't publish .babelrc file

More and more npm packages contain ES2015+ code.
As discussed in [this AMA](https://github.com/sindresorhus/ama/issues/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](https://github.com/facebookincubator/create-react-app/issues/1125) and implemented in [this pull request](https://github.com/facebookincubator/create-react-app/pull/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](https://github.com/Akryum/v-tooltip/pull/90).
This commit is contained in:
Olivier Ligot
2018-01-23 13:51:25 +01:00
parent ea0f2cb833
commit 26716804cb
2 changed files with 1 additions and 10 deletions

1
.npmignore Normal file
View File

@@ -0,0 +1 @@
.babelrc

View File

@@ -85,16 +85,6 @@
"pre-commit": [
"lint"
],
"babel": {
"presets": [
[
"es2015",
{
"modules": false
}
]
]
},
"dependencies": {
"request": "^2.83.0"
}