File tree Expand file tree Collapse file tree 7 files changed +58
-32
lines changed Expand file tree Collapse file tree 7 files changed +58
-32
lines changed Original file line number Diff line number Diff line change 1
- 'use strict'
2
-
3
- const React = require ( 'react' )
4
- const ReactDom = require ( 'react-dom' )
5
- const Tags = require ( '../lib/ReactTags' )
6
- const suggestions = require ( './countries' )
1
+ import React from 'react'
2
+ import ReactDom from 'react-dom'
3
+ import Tags from '../lib/ReactTags'
4
+ import suggestions from './countries'
7
5
8
6
class App extends React . Component {
9
7
constructor ( props ) {
Original file line number Diff line number Diff line change 1
- 'use strict'
2
-
3
- const React = require ( 'react' )
1
+ import React from 'react'
4
2
5
3
const SIZER_STYLES = {
6
4
position : 'absolute' ,
@@ -86,4 +84,4 @@ class Input extends React.Component {
86
84
}
87
85
}
88
86
89
- module . exports = Input
87
+ export default Input
Original file line number Diff line number Diff line change 1
- 'use strict'
2
-
3
- const React = require ( 'react' )
4
- const PropTypes = require ( 'prop-types' )
5
- const Tag = require ( './Tag' )
6
- const Input = require ( './Input' )
7
- const Suggestions = require ( './Suggestions' )
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import Tag from './Tag'
4
+ import Input from './Input'
5
+ import Suggestions from './Suggestions'
8
6
9
7
const KEYS = {
10
8
ENTER : 'Enter' ,
@@ -229,4 +227,4 @@ ReactTags.propTypes = {
229
227
] )
230
228
}
231
229
232
- module . exports = ReactTags
230
+ export default ReactTags
Original file line number Diff line number Diff line change 1
- 'use strict'
2
-
3
- const React = require ( 'react' )
1
+ import React from 'react'
4
2
5
3
function escapeForRegExp ( query ) {
6
4
return query . replace ( / [ - \\ ^ $ * + ? . ( ) | [ \] { } ] / g, '\\$&' )
@@ -78,4 +76,4 @@ class Suggestions extends React.Component {
78
76
}
79
77
}
80
78
81
- module . exports = Suggestions
79
+ export default Suggestions
Original file line number Diff line number Diff line change 1
- 'use strict '
1
+ import React from 'react '
2
2
3
- const React = require ( 'react' )
4
-
5
- module . exports = ( props ) => (
3
+ export default ( props ) => (
6
4
< button type = 'button' className = { props . classNames . selectedTag } title = 'Click to remove tag' onClick = { props . onDelete } >
7
5
< span className = { props . classNames . selectedTagName } > { props . tag . name } </ span >
8
6
</ button >
Original file line number Diff line number Diff line change 3
3
"version" : " 5.4.1" ,
4
4
"description" : " React Tag Autocomplete is a simple tagging component ready to drop in your React projects." ,
5
5
"main" : " dist-es5/ReactTags.js" ,
6
- "jsnext:main " : " dist-es6/ReactTags.js" ,
6
+ "module " : " dist-es6/ReactTags.js" ,
7
7
"scripts" : {
8
- "pretest" : " npm run lint && npm run build:es5 " ,
8
+ "pretest" : " npm run lint && npm run build:dist " ,
9
9
"test" : " jasmine" ,
10
10
"coverage" : " istanbul cover -i 'dist-es5/**' jasmine" ,
11
11
"lint" : " standard lib/*.js spec/*.js" ,
12
12
"dev" : " webpack-dev-server --progress --colors --port ${PORT:-8080} --host 0.0.0.0" ,
13
13
"build:example" : " webpack -p --config-name example" ,
14
- "build:es5" : " buble lib --objectAssign -o dist-es5" ,
15
- "build:es6" : " buble lib --objectAssign -o dist-es6 -t node:6" ,
16
- "prepublish" : " npm run build:es5 && npm run build:es6"
14
+ "build:dist" : " rollup -c rollup.config.js" ,
15
+ "prepublish" : " npm run build:dist"
17
16
},
18
17
"files" : [
19
18
" lib" ,
46
45
"react-dom" : " ^16.0.0"
47
46
},
48
47
"devDependencies" : {
49
- "buble" : " ^0.17 .0" ,
48
+ "buble" : " ^0.18 .0" ,
50
49
"buble-loader" : " ^0.4.1" ,
51
50
"coveralls" : " ^3.0.0" ,
52
51
"istanbul" : " ^0.4.4" ,
55
54
"prop-types" : " ^15.6.0" ,
56
55
"react" : " ^16.0.0" ,
57
56
"react-dom" : " ^16.0.0" ,
57
+ "rollup" : " ^0.54.1" ,
58
+ "rollup-plugin-buble" : " ^0.18.0" ,
58
59
"sinon" : " ^4.0.0" ,
59
60
"standard" : " ^10.0.3" ,
60
61
"webpack" : " ^3.6.0" ,
Original file line number Diff line number Diff line change
1
+ import buble from 'rollup-plugin-buble'
2
+ import pkg from './package.json'
3
+
4
+ const input = 'lib/ReactTags.js'
5
+
6
+ const external = [
7
+ 'react' ,
8
+ 'react-dom' ,
9
+ 'prop-types'
10
+ ]
11
+
12
+ export default [
13
+ {
14
+ input,
15
+ external,
16
+ plugins : [
17
+ buble ( { objectAssign : 'Object.assign' , target : { node : 6 } } )
18
+ ] ,
19
+ output : {
20
+ file : pkg . module ,
21
+ format : 'es'
22
+ }
23
+ } ,
24
+ {
25
+ input,
26
+ external,
27
+ plugins : [
28
+ buble ( { objectAssign : 'Object.assign' } )
29
+ ] ,
30
+ output : {
31
+ file : pkg . main ,
32
+ format : 'cjs'
33
+ }
34
+ }
35
+ ]
You can’t perform that action at this time.
0 commit comments