Skip to content

Commit

Permalink
add es build
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed May 7, 2018
1 parent 9b2a2c4 commit 9f2e3f3
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 11 deletions.
10 changes: 9 additions & 1 deletion .babelrc.js
@@ -1,3 +1,11 @@
module.exports = {
"presets": [["jason", { "runtime": false }]]
presets: [
[
'jason',
{
runtime: false,
modules: process.env.BABEL_ENV === 'esm' ? false : 'commonjs',
},
],
],
}
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
/lib
/es

# Logs
logs
Expand Down
15 changes: 7 additions & 8 deletions package.json
Expand Up @@ -2,7 +2,8 @@
"name": "react-formal",
"version": "0.27.0",
"description": "Classy HTML form management for React",
"main": "lib/index.js",
"main": "lib/index.cjs.js",
"modules": "es/index.js",
"author": {
"name": "Jason Quense",
"email": "monastic.panic@gmail.com"
Expand All @@ -13,9 +14,7 @@
"url": "https://github.com/jquense/react-formal"
},
"license": "MIT",
"files": [
"lib"
],
"files": ["lib", "es"],
"keywords": [
"react-formal",
"react",
Expand All @@ -29,9 +28,7 @@
"yup"
],
"jest": {
"roots": [
"<rootDir>/test"
],
"roots": ["<rootDir>/test"],
"setupTestFrameworkScriptFile": "./test/index.js"
},
"scripts": {
Expand All @@ -40,7 +37,8 @@
"lint": "eslint src",
"docs": "webpack --config docs/webpack.config.js --progress",
"docs:watch": "webpack-dev-server --config docs/webpack.config.js",
"build": " babel src --out-dir lib --copy-files",
"build:esm": "BABEL_ENV=esm babel src --out-dir es --copy-files",
"build": " babel src --out-dir lib --copy-files && npm run build:esm",
"release": "release"
},
"peerDependencies": {
Expand Down Expand Up @@ -89,6 +87,7 @@
"react-bootstrap": "^0.32.1",
"react-component-metadata": "^3.0.0",
"react-dom": "^16.3.2",
"react-formal": "^0.27.0",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"release-script": "^1.0.2",
Expand Down
3 changes: 3 additions & 0 deletions src/index.cjs.js
@@ -0,0 +1,3 @@
const ReactFormal = require('./index.js')

module.exports = ReactFormal.default
4 changes: 2 additions & 2 deletions src/index.js
Expand Up @@ -34,7 +34,7 @@ const statics = {

Object.assign(Form, statics)

Form.statics = statics

export { statics }
export default Form

module.exports = Form
16 changes: 16 additions & 0 deletions yarn.lock
Expand Up @@ -6633,6 +6633,22 @@ react-dom@^16.3.2:
object-assign "^4.1.1"
prop-types "^15.6.0"

react-formal@^0.27.0:
version "0.27.0"
resolved "https://registry.yarnpkg.com/react-formal/-/react-formal-0.27.0.tgz#16ed6423eab27cbe005418f46d55b4f530b8b0d8"
dependencies:
chain-function "^1.0.0"
classnames "^2.2.5"
invariant "^2.2.4"
lodash "^4.17.10"
prop-types "^15.6.1"
property-expr "^1.4.0"
react-lifecycles-compat "^3.0.2"
topeka "^3.0.0"
uncontrollable "^6.0.0"
warning "^3.0.0"
yup "^0.24.1"

react-is@^16.3.2:
version "16.3.2"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.3.2.tgz#f4d3d0e2f5fbb6ac46450641eb2e25bf05d36b22"
Expand Down

0 comments on commit 9f2e3f3

Please sign in to comment.