Skip to content

Commit

Permalink
Fix dist build
Browse files Browse the repository at this point in the history
Adding the named exports in c15f1cd seems to have broken the dist build. Fortunately webpack's `output.libraryExport` solves this for us
  • Loading branch information
cookpete committed Dec 5, 2018
1 parent 32e8286 commit 29fb971
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -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",
Expand Down
8 changes: 3 additions & 5 deletions webpack.dist.babel.js
Expand Up @@ -7,7 +7,8 @@ export default {
output: {
path: path.join(__dirname, 'dist'),
filename: 'ReactPlayer.js',
library: 'ReactPlayer'
library: 'ReactPlayer',
libraryExport: 'default'
},
externals: {
'react': 'React'
Expand All @@ -16,10 +17,7 @@ export default {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
options: {
plugins: ['add-module-exports']
}
loader: 'babel-loader'
}
]
},
Expand Down
8 changes: 3 additions & 5 deletions webpack.standalone.babel.js
Expand Up @@ -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'
}
]
},
Expand Down
4 changes: 0 additions & 4 deletions yarn.lock
Expand Up @@ -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"
Expand Down

0 comments on commit 29fb971

Please sign in to comment.