File tree 6 files changed +68
-49
lines changed
6 files changed +68
-49
lines changed Original file line number Diff line number Diff line change 1
- /** @jsx React.DOM */
2
-
3
1
var React = require ( 'react' ) ;
4
2
var ReactDOM = require ( 'react-dom' ) ;
5
3
var Menu = require ( '../../lib/index' ) ;
Original file line number Diff line number Diff line change 21
21
],
22
22
"license" : " MIT" ,
23
23
"devDependencies" : {
24
- "browserify" : " 13.0.0" ,
25
- "browserify-shim" : " 3.8.12" ,
24
+ "babel-core" : " 6.13.2" ,
25
+ "babel-loader" : " 6.2.4" ,
26
+ "babel-plugin-transform-object-rest-spread" : " 6.8.0" ,
27
+ "babel-preset-es2015" : " 6.13.2" ,
28
+ "babel-preset-react" : " 6.11.1" ,
26
29
"envify" : " 3.4.0" ,
27
30
"expect" : " 1.14.0" ,
28
31
"jsx-loader" : " 0.13.2" ,
37
40
"react" : " ^0.14.7" ,
38
41
"react-addons-test-utils" : " ^0.14.7" ,
39
42
"react-dom" : " ^0.14.7" ,
40
- "reactify" : " ^1.1.1" ,
41
43
"rf-release" : " 0.4.0" ,
42
44
"uglify-js" : " 2.6.1" ,
43
45
"webpack" : " 1.13.1" ,
57
59
" menu" ,
58
60
" dropdown"
59
61
],
60
- "browserify-shim" : {
61
- "react" : " global:React"
62
- },
63
- "browserify" : {
64
- "transform" : [
65
- " reactify"
66
- ]
67
- },
68
62
"dependencies" : {
69
63
"js-stylesheet" : " 0.0.1"
70
64
}
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
mkdir -p dist
3
- NODE_ENV=production node_modules/.bin/browserify lib/index.js \
4
- -t reactify \
5
- -t browserify-shim \
6
- -t envify \
7
- --detect-globals false \
8
- -s ReactMenu > dist/react-menu.js
3
+ node_modules/.bin/webpack
9
4
node_modules/.bin/uglifyjs dist/react-menu.js \
10
5
--compress warnings=false > dist/react-menu.min.js
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- node_modules/.bin/webpack-dev-server --inline --content-base examples/
2
+ node_modules/.bin/webpack-dev-server --inline --config webpack.examples-config.js -- content-base examples/
Original file line number Diff line number Diff line change 1
- var fs = require ( 'fs' ) ;
2
- var path = require ( 'path' ) ;
3
-
4
- var EXAMPLES_DIR = path . resolve ( __dirname , 'examples' ) ;
5
-
6
- function isDirectory ( dir ) {
7
- return fs . lstatSync ( dir ) . isDirectory ( ) ;
8
- }
9
-
10
- function buildEntries ( ) {
11
- return fs . readdirSync ( EXAMPLES_DIR ) . reduce ( function ( entries , dir ) {
12
- if ( dir === 'build' )
13
- return entries ;
14
-
15
- var isDraft = dir . charAt ( 0 ) === '_' ;
16
-
17
- if ( ! isDraft && isDirectory ( path . join ( EXAMPLES_DIR , dir ) ) )
18
- entries [ dir ] = path . join ( EXAMPLES_DIR , dir , 'app.js' ) ;
19
-
20
- return entries ;
21
- } , { } ) ;
22
- }
23
-
24
1
module . exports = {
25
-
26
- entry : buildEntries ( ) ,
2
+ entry : {
3
+ 'react-menu' : './lib/index.js'
4
+ } ,
27
5
28
6
output : {
7
+ library : "ReactMenu" ,
8
+ libraryTarget : "umd" ,
29
9
filename : '[name].js' ,
30
- chunkFilename : '[id].chunk.js' ,
31
- path : 'examples/__build__' ,
32
- publicPath : '/__build__/'
10
+ path : 'dist' ,
33
11
} ,
34
12
35
13
module : {
36
14
loaders : [
37
- { test : / \. ( j s | j s x ) $ / , loader : 'jsx-loader?harmony' }
15
+ {
16
+ test : / \. j s $ / ,
17
+ loader : 'babel' ,
18
+ query : {
19
+ presets : [ 'react' , 'es2015' ] ,
20
+ plugins : [ 'transform-object-rest-spread' ] ,
21
+ } ,
22
+ }
38
23
]
39
24
} ,
40
25
} ;
Original file line number Diff line number Diff line change
1
+ var fs = require ( 'fs' ) ;
2
+ var path = require ( 'path' ) ;
3
+
4
+ var EXAMPLES_DIR = path . resolve ( __dirname , 'examples' ) ;
5
+
6
+ function isDirectory ( dir ) {
7
+ return fs . lstatSync ( dir ) . isDirectory ( ) ;
8
+ }
9
+
10
+ function buildEntries ( ) {
11
+ return fs . readdirSync ( EXAMPLES_DIR ) . reduce ( function ( entries , dir ) {
12
+ if ( dir === 'build' )
13
+ return entries ;
14
+
15
+ var isDraft = dir . charAt ( 0 ) === '_' ;
16
+
17
+ if ( ! isDraft && isDirectory ( path . join ( EXAMPLES_DIR , dir ) ) )
18
+ entries [ dir ] = path . join ( EXAMPLES_DIR , dir , 'app.js' ) ;
19
+
20
+ return entries ;
21
+ } , { } ) ;
22
+ }
23
+
24
+ module . exports = {
25
+ entry : buildEntries ( ) ,
26
+
27
+ output : {
28
+ filename : '[name].js' ,
29
+ chunkFilename : '[id].chunk.js' ,
30
+ path : 'examples/__build__' ,
31
+ publicPath : '/__build__/'
32
+ } ,
33
+
34
+ module : {
35
+ loaders : [
36
+ {
37
+ test : / \. j s $ / ,
38
+ exclude : [ / n o d e _ m o d u l e s / ] , // speed up examples by not babel-ing dependencies
39
+ loader : 'babel' ,
40
+ query : {
41
+ presets : [ 'react' , 'es2015' ] ,
42
+ plugins : [ 'transform-object-rest-spread' ] ,
43
+ } ,
44
+ }
45
+ ]
46
+ } ,
47
+ } ;
You can’t perform that action at this time.
0 commit comments