From 29fb971efae61ae90b66fca07f2bc36c55b7cc21 Mon Sep 17 00:00:00 2001 From: Pete Cook Date: Sat, 1 Dec 2018 09:46:08 +0000 Subject: [PATCH] Fix dist build Adding the named exports in c15f1cdfa6c1e97634087bb9eedf6508ef9a7682 seems to have broken the dist build. Fortunately webpack's `output.libraryExport` solves this for us --- package.json | 1 - webpack.dist.babel.js | 8 +++----- webpack.standalone.babel.js | 8 +++----- yarn.lock | 4 ---- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index c931a63a..34169f73 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "babel-core": "^6.16.0", "babel-eslint": "^8.2.1", "babel-loader": "^7.0.0", - "babel-plugin-add-module-exports": "^0.2.1", "babel-plugin-istanbul": "^4.1.4", "babel-plugin-transform-es3-member-expression-literals": "^6.8.0", "babel-plugin-transform-es3-property-literals": "^6.8.0", diff --git a/webpack.dist.babel.js b/webpack.dist.babel.js index b8766434..309a661e 100644 --- a/webpack.dist.babel.js +++ b/webpack.dist.babel.js @@ -7,7 +7,8 @@ export default { output: { path: path.join(__dirname, 'dist'), filename: 'ReactPlayer.js', - library: 'ReactPlayer' + library: 'ReactPlayer', + libraryExport: 'default' }, externals: { 'react': 'React' @@ -16,10 +17,7 @@ export default { rules: [ { test: /\.js$/, - loader: 'babel-loader', - options: { - plugins: ['add-module-exports'] - } + loader: 'babel-loader' } ] }, diff --git a/webpack.standalone.babel.js b/webpack.standalone.babel.js index 54cb936d..f6b9142d 100644 --- a/webpack.standalone.babel.js +++ b/webpack.standalone.babel.js @@ -7,16 +7,14 @@ export default { output: { path: path.join(__dirname, 'dist'), filename: 'ReactPlayer.standalone.js', - library: 'renderReactPlayer' + library: 'renderReactPlayer', + libraryExport: 'default' }, module: { rules: [ { test: /\.js$/, - loader: 'babel-loader', - options: { - plugins: ['add-module-exports'] - } + loader: 'babel-loader' } ] }, diff --git a/yarn.lock b/yarn.lock index f58da83d..c9e60df6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -758,10 +758,6 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-add-module-exports@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz#9ae9a1f4a8dc67f0cdec4f4aeda1e43a5ff65e25" - babel-plugin-check-es2015-constants@^6.22.0, babel-plugin-check-es2015-constants@^6.8.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a"