Skip to content

Commit

Permalink
Update bundling scheme
Browse files Browse the repository at this point in the history
This commit sets things up to work properly when
publishing to npm.  Prior to publishing the package
items from the src/ folder will be processed with Babel
and stored in the lib/ folder. The lib/ folder will
not be present in the repository.  The src/ folder similarly
will not be available when looking at the installed package.

In addition this commit also fixes #332 by adding the
`babel-plugin-transform-object-assign` plugin and removing
`lodash.assign`
  • Loading branch information
claydiffrient committed Mar 5, 2017
1 parent a8b7aa0 commit cae983a
Show file tree
Hide file tree
Showing 12 changed files with 948 additions and 958 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"presets": ["react", "latest", "stage-2"]
"presets": ["react", "latest", "stage-2"],
"plugins": ["babel-plugin-transform-object-assign"]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
.idea/
_book
coverage
lib
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ karma.conf.js
script
specs
.idea/
src
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@
"docs:build": "gitbook build -g reactjs/react-modal",
"docs:build:watch": "gitbook serve",
"docs:publish": "cd _book && git init && git commit --allow-empty -m 'update book' && git checkout -b gh-pages && touch .nojekyll && git add . && git commit -am 'update book' && git push git@github.com:reactjs/react-modal gh-pages --force",
"lint": "eslint lib/ specs/"
"lint": "eslint lib/ specs/",
"prepublish": "babel src -d lib"
},
"authors": [
"Ryan Florence"
],
"license": "MIT",
"devDependencies": {
"babel-cli": "^6.23.0",
"babel-core": "^6.7.4",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.4",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-preset-es2015": "^6.6.0",
"babel-preset-latest": "^6.16.0",
"babel-preset-react": "^6.5.0",
Expand Down Expand Up @@ -72,8 +75,7 @@
},
"dependencies": {
"element-class": "^0.2.0",
"exenv": "1.2.0",
"lodash.assign": "^4.2.0"
"exenv": "1.2.0"
},
"peerDependencies": {
"react": "^0.14.0 || ^15.0.0",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component, PropTypes } from 'react';
import Assign from 'lodash.assign';
import scopeTab from '../helpers/scopeTab';
import {
returnFocus,
Expand Down Expand Up @@ -211,12 +210,12 @@ export default class ModalPortal extends Component {
<div
ref={(c) => { this.overlay = c; }}
className={this.buildClassName('overlay', this.props.overlayClassName)}
style={Assign({}, overlayStyles, this.props.style.overlay || {})}
style={Object.assign({}, overlayStyles, this.props.style.overlay || {})}
onClick={this.handleOverlayOnClick}
>
<div
ref={(c) => { this.content = c; }}
style={Assign({}, contentStyles, this.props.style.content || {})}
style={Object.assign({}, contentStyles, this.props.style.content || {})}
className={this.buildClassName('content', this.props.className)}
tabIndex={-1}
onKeyDown={this.handleKeyDown}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cae983a

Please sign in to comment.