Skip to content

Commit 2671680

Browse files
committed
Don't publish .babelrc file
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).
1 parent ea0f2cb commit 2671680

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.babelrc

package.json

-10
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,6 @@
8585
"pre-commit": [
8686
"lint"
8787
],
88-
"babel": {
89-
"presets": [
90-
[
91-
"es2015",
92-
{
93-
"modules": false
94-
}
95-
]
96-
]
97-
},
9888
"dependencies": {
9989
"request": "^2.83.0"
10090
}

0 commit comments

Comments
 (0)