From 26716804cbb5dc68f45994216ba7889d5c06ecb1 Mon Sep 17 00:00:00 2001 From: Olivier Ligot Date: Tue, 23 Jan 2018 13:51:25 +0100 Subject: [PATCH] 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). --- .npmignore | 1 + package.json | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..02ba179 --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +.babelrc diff --git a/package.json b/package.json index d0a8708..102095b 100644 --- a/package.json +++ b/package.json @@ -85,16 +85,6 @@ "pre-commit": [ "lint" ], - "babel": { - "presets": [ - [ - "es2015", - { - "modules": false - } - ] - ] - }, "dependencies": { "request": "^2.83.0" }