Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
fix(umd): add json plugin (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds authored Apr 7, 2017
1 parent 1293859 commit 47c26e0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"rollup": "^0.41.6",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-json": "^2.1.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-uglify": "^1.0.1",
"semantic-release": "^6.3.6",
Expand Down
2 changes: 2 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import rollupBabel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import nodeResolve from 'rollup-plugin-node-resolve'
import json from 'rollup-plugin-json'
import uglify from 'rollup-plugin-uglify'

const minify = process.env.MINIFY
Expand All @@ -25,6 +26,7 @@ export default {
plugins: [
nodeResolve({jsnext: true, main: true}),
commonjs({include: 'node_modules/**'}),
json(),
rollupBabel({
exclude: 'node_modules/**',
babelrc: false,
Expand Down
8 changes: 8 additions & 0 deletions src/dom-elements.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import htmlTagNames from 'html-tag-names'
import svgTagNames from 'svg-tag-names'

const domElements = htmlTagNames
.concat(svgTagNames)
.filter((tag, index, array) => array.indexOf(tag) === index)

export default domElements
8 changes: 1 addition & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@
import React from 'react'
import {css, styleSheet} from 'glamor'
import shouldForwardProperty from './should-forward-property'

const htmlTagNames = require('html-tag-names')
const svgTagNames = require('svg-tag-names')

const domElements = htmlTagNames
.concat(svgTagNames)
.filter((tag, index, array) => array.indexOf(tag) === index)
import domElements from './dom-elements'

const {PropTypes} = React

Expand Down
8 changes: 7 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5285,6 +5285,12 @@ rollup-plugin-commonjs@^8.0.2:
resolve "^1.1.7"
rollup-pluginutils "^2.0.1"

rollup-plugin-json@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-json/-/rollup-plugin-json-2.1.0.tgz#7f8e1b2b156932dd934b938dc5547e4118d4121f"
dependencies:
rollup-pluginutils "^1.5.2"

rollup-plugin-node-resolve@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.0.tgz#8b897c4c3030d5001277b0514b25d2ca09683ee0"
Expand All @@ -5300,7 +5306,7 @@ rollup-plugin-uglify@^1.0.1:
dependencies:
uglify-js "^2.6.1"

rollup-pluginutils@^1.5.0:
rollup-pluginutils@^1.5.0, rollup-pluginutils@^1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408"
dependencies:
Expand Down

0 comments on commit 47c26e0

Please sign in to comment.