Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
{
"name": "react-final-form-html5-validation",
"version": "1.0.0",
"description":
"A swap-in replacement for 🏁 React Final Form's <Field> component to provide HTML5 Validation",
"description": "A swap-in replacement for 🏁 React Final Form's <Field> component to provide HTML5 Validation",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my npm formats package.json when doing a fresh install for some reason, no idea how to stop it (havent searched for it though 😉 ). Hope it's ok

"main": "dist/react-final-form-html5-validation.cjs.js",
"jsnext:main": "dist/react-final-form-html5-validation.es.js",
"module": "dist/react-final-form-html5-validation.es.js",
"sideEffects": false,
"files": ["dist"],
"files": [
"dist"
],
"scripts": {
"start": "nps",
"test": "nps test",
"precommit": "lint-staged && npm start validate"
},
"author":
"Erik Rasmussen <rasmussenerik@gmail.com> (http://github.com/erikras)",
"author": "Erik Rasmussen <rasmussenerik@gmail.com> (http://github.com/erikras)",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/final-form/react-final-form-html5-validation.git"
},
"bugs": {
"url":
"https://github.com/final-form/react-final-form-html5-validation/issues"
"url": "https://github.com/final-form/react-final-form-html5-validation/issues"
},
"homepage":
"https://github.com/final-form/react-final-form-html5-validation#readme",
"homepage": "https://github.com/final-form/react-final-form-html5-validation#readme",
"devDependencies": {
"babel-eslint": "^8.2.2",
"babel-jest": "^22.4.1",
Expand Down Expand Up @@ -74,10 +72,15 @@
"react-final-form": ">=3.0.0"
},
"jest": {
"setupFiles": ["raf/polyfill"]
"setupFiles": [
"raf/polyfill"
]
},
"lint-staged": {
"*.{js*,ts*,json,md,css}": ["prettier --write", "git add"]
"*.{js*,ts*,json,md,css}": [
"prettier --write",
"git add"
]
},
"bundlesize": [
{
Expand Down
9 changes: 7 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import flow from 'rollup-plugin-flow'
import commonjs from 'rollup-plugin-commonjs'
import uglify from 'rollup-plugin-uglify'
import replace from 'rollup-plugin-replace'
import pkg from './package.json'

const minify = process.env.MINIFY
const format = process.env.FORMAT
Expand Down Expand Up @@ -41,6 +42,9 @@ if (es) {
throw new Error('no format specified. --environment FORMAT:xxx')
}

const deps = Object.keys(pkg.dependencies || {})
const peers = Object.keys(pkg.peerDependencies || {})

export default {
input: 'src/index.js',
output: Object.assign(
Expand All @@ -49,18 +53,19 @@ export default {
exports: 'named',
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'prop-types': 'PropTypes',
'final-form': 'FinalForm',
'react-final-form': 'ReactFinalForm'
}
},
output
),
external: ['react', 'prop-types', 'final-form', 'react-final-form'],
external: umd ? peers : deps.concat(peers),
plugins: [
resolve({ jsnext: true, main: true }),
flow(),
commonjs({ include: 'node_modules/**' }),
umd && commonjs({ include: 'node_modules/**' }),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just extra guard, for non-umd build u dont want to use this plugin at all

babel({
exclude: 'node_modules/**',
babelrc: false,
Expand Down